chiark / gitweb /
at: Add test case for move while displaced
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Mar 2021 17:04:57 +0000 (17:04 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Mar 2021 19:59:14 +0000 (19:59 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs

index 91e9306c9c4c3c4d1d2257132fc992e4b23b3730..10bcf578101e0e1c28098e591633b082a3abf337 100644 (file)
@@ -581,6 +581,25 @@ impl Ctx {
       assert_eq!(got, None);
     }
 
+    {
+      let p = a_pawns[0];
+      let alice_move_to = (a_pieces[p].pos + PosC([5, 5]))?;
+      let mut a_p = (&mut a_pieces, p);
+
+      alice.api_piece(GH::Grab, PuSynch(&mut a_p), ())?;
+      bob.synchu(&mut b_pieces)?;
+
+      alice.api_piece(GH::Raw, &mut a_p, alice_move_to)?;
+      bob.synchx(Some(&mut b_pieces), None, |sess, gen, k, v| {
+        dbg!(gen, k, v);
+        panic!("bob saw something when alice moved displaced occulted");
+      })?;
+
+      alice.api_piece(GH::Ungrab, a_p, ())?;
+      alice.synchu(&mut a_pieces)?;
+      bob.synchu(&mut b_pieces)?;
+    }
+
     // ^ also do the above after alice has grasped and moved
     //   but not yet released.  currently this is buggy  xxx