chiark / gitweb /
at-currency: wip occult test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 May 2022 18:56:06 +0000 (19:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 May 2022 18:56:54 +0000 (19:56 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-currency.rs

index 62b71f640610e0958a1b8df4bd87884d42098429..478871ca708d653cd47977742900d8113064e65a 100644 (file)
@@ -48,11 +48,31 @@ impl Ctx {
     let _ = bank;
     let _ = pile;
   }
+
+  #[throws(Explode)]
+  fn occult(&mut self) {
+    self.clear_reset_to_demo()?;
+
+    let mut alice = self.connect_player(&self.alice)?;
+    let mut a_pieces = alice.pieces::<PIA>()?;
+
+    let mut bob = self.connect_player(&self.bob)?;
+
+    let hand = a_pieces.find_by_desc_glob(otter::hand::UNCLAIMED_HAND_DESC);
+    alice.api_piece(GH::With, PuSynch(&mut (&mut a_pieces, hand)),
+                    ("k", json!({ "opname": "claim",
+                                   "wrc": WRC::Unpredictable })))?;
+    let hand_pos = a_pieces[hand].pos;
+
+    let _ = &mut bob;
+    let _ = bob;
+  }
 }
 
 #[throws(Explode)]
 fn tests(mut c: Ctx) {
   test!(c, "multigrab",                     c.multigrab()              ?);
+  test!(c, "occult",                        c.occult()                 ?);
 }
 
 #[throws(Explode)]