chiark / gitweb /
at-hidden: Add more test, completing repro of unnotched bug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Apr 2022 22:29:41 +0000 (23:29 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 25 Apr 2022 00:31:17 +0000 (01:31 +0100)
This test fails without the unnotched piece tracking.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-hidden.rs

index 03f484e17395130dca98860c9a933f6d31acc8aa..cfd4c8141665f377fd1592173b5b6e815f3b3012 100644 (file)
@@ -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 })))?;
   }
 }