From: Ian Jackson Date: Sat, 27 Feb 2021 00:28:48 +0000 (+0000) Subject: apitest: rerun otter library-add X-Git-Tag: otter-0.4.0~340 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2ef3823aad08aa2c6f812cc1bdb4815f3d383183;p=otter.git apitest: rerun otter library-add Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 98454cb0..201f87f3 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -270,9 +270,10 @@ impl Ctx { fn library_load(&mut self) { prepare_game(&self.ds, TABLE)?; - let add_err = self.otter(&self.ds.ss( + let command = self.ds.ss( "library-add @table@ wikimedia chess-blue-?" - )?) + )?; + let add_err = self.otter(&command) .expect_err("library-add succeeded after reset!"); ensure_eq!(add_err.downcast::()?.0.code(), Some(EXIT_NOTFOUND)); @@ -289,10 +290,14 @@ impl Ctx { for (llm, pos) in izip!(&llm, [PosC([5,5]), PosC([50,25])].iter()) { session.api_piece_op(&self.su, &llm.id, "grab", json!({}))?; session.api_piece_op(&self.su, &llm.id, "m", json![pos.0])?; + session.api_piece_op(&self.su, &llm.id, "ungrab", json!({}))?; } session.resynch_pieces()?; + self.otter(&command) + .expect("library-add failed after place!"); + // xxx send api requests to move markers // run library-add again }