From: Ian Jackson Date: Sun, 1 May 2022 18:08:29 +0000 (+0100) Subject: apitest: updates: implement Insert X-Git-Tag: otter-1.1.0~342 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cd67d31330c94eca4891b9a1182bcab09ddc0eaa;p=otter.git apitest: updates: implement Insert Signed-off-by: Ian Jackson --- diff --git a/apitest/atmain.rs b/apitest/atmain.rs index b2e383bc..be0ad7ee 100644 --- a/apitest/atmain.rs +++ b/apitest/atmain.rs @@ -434,6 +434,15 @@ pub fn update_update_pieces( let (op, d) = v["op"].as_object().unwrap().iter().next().unwrap(); match op.as_str() { + "Insert" | "InsertQuiet" => { + assert!(p.is_none()); + let piece = v["piece"].as_str().unwrap(); + pieces.push(PieceInfo { + id: piece.into(), + pos: coord(d.get("pos").unwrap()), + info: d.clone(), + }); + }, "Move" => { p.unwrap().pos = coord(d); },