@@ -47,8 +47,9 @@ local function write_session(cwd, id, ts)
4747 return file
4848end
4949
50- -- Case 1: done_candidates includes a live agent and a disk-only (non-roster)
51- -- session; excludes a done one and an archived one.
50+ -- Case 1: done_candidates includes a live agent, a disk-only (non-roster)
51+ -- session, and an already-done one (so it can be un-done); excludes an
52+ -- archived one.
5253local C1 = " /proj/c1"
5354local id_plain = " 11111111-1111-1111-1111-111111111111"
5455local id_done = " 11111111-1111-1111-1111-111111111112"
@@ -69,7 +70,7 @@ local dc = board.done_candidates(C1)
6970check (" case1 plain present" , has_id (dc , id_plain ))
7071check (" case1 live included" , has_id (dc , id_live ))
7172check (" case1 disk-only included" , has_id (dc , id_disk ))
72- check (" case1 done excluded " , not has_id (dc , id_done ))
73+ check (" case1 done included " , has_id (dc , id_done ))
7374check (" case1 archived excluded" , not has_id (dc , id_arch ))
7475check (" case1 row shape" , find_id (dc , id_live ).live == true )
7576
@@ -107,7 +108,9 @@ roster.ensure({ id = row3.id, type = "pi", name = row3.name, cwd = row3.cwd })
107108roster .mark_done (row3 .id )
108109check (" case3 entry materialized" , roster .get (id3 ) ~= nil )
109110check (" case3 marked done" , roster .get (id3 ).done == true )
110- check (" case3 drops out of done_candidates" , not has_id (board .done_candidates (C3 ), id3 ))
111+ check (" case3 stays in done_candidates so it can be un-done" , has_id (board .done_candidates (C3 ), id3 ))
112+ roster .set_done (row3 .id , false )
113+ check (" case3 toggling again via set_done reverts done to false" , roster .get (id3 ).done == false )
111114
112115-- Case 4: materialize-then-flag archive toggling a previously-untracked row.
113116local C4 = " /proj/c4"
0 commit comments