From: Ian Jackson Date: Sat, 27 Feb 2021 18:38:00 +0000 (+0000) Subject: hand: Start on a test X-Git-Tag: otter-0.4.0~305 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8eab37c4533d98447f641caecacdbce7bd962ea0;p=otter.git hand: Start on a test Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index df4cc91b..c73e06d6 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -316,11 +316,27 @@ impl Ctx { dbg!(&added); ensure_eq!(added.len(), 6); } + + #[throws(AE)] + fn hidden_hand(&mut self) { + prepare_game(&self.ds, TABLE)?; + let mut session = self.connect_player(&self.alice)?; + + let pieces = session.pieces()?; + let [hand] = pieces.into_iter() + .filter(|p| p.info["desc"] == "a hand repository") + .collect::>() + .into_inner().unwrap(); + dbg!(hand); + + session.synch(&mut self.su)?; + } } #[throws(AE)] fn tests(mut c: Ctx) { test!(c, "library-load", c.library_load()?); + test!(c, "hidden-hand", c.hidden_hand()?); } #[throws(AE)]