From: Ian Jackson Date: Fri, 20 May 2022 18:56:06 +0000 (+0100) Subject: at-currency: wip occult test X-Git-Tag: otter-1.1.0~39 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=41fdebbedb6d153be57aeb155efb793ecc638156;p=otter.git at-currency: wip occult test Signed-off-by: Ian Jackson --- diff --git a/apitest/at-currency.rs b/apitest/at-currency.rs index 62b71f64..478871ca 100644 --- a/apitest/at-currency.rs +++ b/apitest/at-currency.rs @@ -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::()?; + + 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)]