From: Ian Jackson Date: Sun, 28 Feb 2021 11:35:44 +0000 (+0000) Subject: hidden test: Move some pawns into hand area X-Git-Tag: otter-0.4.0~287 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=75e95ee19ba842a679d8cfd8a1d59b90c45d2a46;p=otter.git hidden test: Move some pawns into hand area Display etc. is still not working Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 4b52b96d..e7085418 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -329,12 +329,26 @@ impl Ctx { let mut session = self.connect_player(&self.alice)?; let pieces = session.pieces()?; - let [hand] = pieces.into_iter() + + let [hand] = pieces.iter() .filter(|p| p.info["desc"] == otter::hand::UNCLAIMED_DESC) .collect::>() .into_inner().unwrap(); dbg!(&hand); + let pawns: [_;2] = pieces.iter() + .filter(|p| p.info["desc"].as_str().unwrap().ends_with(" pawn")) + .take(2) + .collect::>() + .into_inner().unwrap(); + dbg!(&pawns); + + for (pawn, &xoffset) in izip!(&pawns, [-20,-10].iter()) { + session.api_with_piece_op(&self.su, &pawn.id, "m", json![ + (hand.pos + PosC([xoffset, 0]))?.0 + ])?; + } + session.api_with_piece_op(&self.su, &hand.id, "k", json!({ "opname": "claim", "wrc": "Unpredictable",