chiark / gitweb /
at-currency: More test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 20:03:27 +0000 (21:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 20:04:18 +0000 (21:04 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-currency.rs

index d68756955c21572cb753a0c5163a24f7b0f146dd..d540662e62168e3d2cafaa33542e8dfc331acacf 100644 (file)
@@ -15,6 +15,7 @@ impl Ctx {
     let bn1 = a_pieces.find_by_desc_glob("*400ƒ*");
 
     let other_pile = PosC::new(40,20);
+    let temp_pos = PosC::new(40,10);
 
     alice.api_piece_op_single(PuSynch((&mut a_pieces, bn1)).id(), (
       "multigrab", json!({ "n": 50, 'z': "q000000000" })
@@ -22,11 +23,20 @@ impl Ctx {
     alice.synchu(&mut a_pieces)?;
 
     a_pieces[bn1].assert_desc_contains(" 50ƒ");
-    let _change = a_pieces.find_by_desc_glob("* 350ƒ*");
+    let bn2 = a_pieces.find_by_desc_glob("* 350ƒ*");
 
     alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, bn1)), other_pile)?;
     alice.synchu(&mut a_pieces)?;
 
+    alice.api_piece_op_single(PuSynch((&mut a_pieces, bn2)).id(), (
+      "multigrab", json!({ "n": 13, 'z': "t000000000" })
+    ))?;
+    alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, bn2)), temp_pos)?;
+    alice.synchu(&mut a_pieces)?;
+    a_pieces[bn2].assert_desc_contains(" 13ƒ");
+
+    let _bn3 = a_pieces.find_by_desc_glob("* 337ƒ*");
+
   }
 }