From: Ian Jackson Date: Sun, 24 Apr 2022 22:29:41 +0000 (+0100) Subject: at-hidden: Add more test, completing repro of unnotched bug X-Git-Tag: otter-1.1.0~443 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5cbfdce14b5017a80f1480581188c8e5d5286ce2;p=otter.git at-hidden: Add more test, completing repro of unnotched bug This test fails without the unnotched piece tracking. Signed-off-by: Ian Jackson --- diff --git a/apitest/at-hidden.rs b/apitest/at-hidden.rs index 03f484e1..cfd4c814 100644 --- a/apitest/at-hidden.rs +++ b/apitest/at-hidden.rs @@ -23,7 +23,7 @@ impl Ctx { let hand = a_pieces.find_by_desc_glob(otter::hand::UNCLAIMED_HAND_DESC); let hand_pos = a_pieces[hand].pos; let die_a = a_pieces.find_by_desc_glob("a d2 *"); - let die_red = a_pieces.find_by_desc_glob("a d2 *"); + let die_red = a_pieces.find_by_desc_glob("a red die *"); let move_into_hand = |alice: &mut Session, a_pieces: &'_ mut _, p, x_off| { let pos = (hand_pos + PosC::new(x_off,0))?; @@ -35,9 +35,17 @@ impl Ctx { alice.api_piece(GH::With, PuSynch(&mut (&mut a_pieces, hand)), ("k", json!({ "opname": "claim", "wrc": WRC::Unpredictable })))?; - move_into_hand(&mut alice, &mut a_pieces, die_a, 10)?; + move_into_hand(&mut alice, &mut a_pieces, die_red, 10)?; - // TODO rest of this test + self.su().mgmt_conn().cmd(&MC::SetFakeTime(FakeTimeSpec(Some(6000))))?; + alice.synch()?; + alice.api_piece(GH::With, PuSynch(&mut (&mut a_pieces, die_red)), + ("k", json!({ "opname": "roll", + "wrc": WRC::UpdateSvg })))?; + + alice.api_piece(GH::With, PuSynch(&mut (&mut a_pieces, hand)), + ("k", json!({ "opname": "deactivate", + "wrc": WRC::Unpredictable })))?; } }