chiark / gitweb /
apitest: Use new OtterArgsSpec in a few places
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 19:42:13 +0000 (20:42 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 19:46:02 +0000 (20:46 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs
apitest/main.rs

index d86d25402ead35c56fd8a890c83dca5e3f93cc16..955e93227d59d92bc504f1ceb8a4d8f5002166e3 100644 (file)
@@ -11,19 +11,17 @@ impl Ctx {
   fn library_load(&mut self) {
     self.prepare_game()?;
 
-    let command = self.ds().gss(
-      "library-list chess-yellow-?"
-    )?;
-    let output: String = self.otter(&command)?.into();
+    let output: String = self.otter(
+      &G("library-list chess-yellow-?")
+    )?.into();
     assert!( Regex::new("(?m)^wikimedia  *chess-yellow-K  *the yellow king$")?
              .find(&output)
              .is_some(),
              "got: {}", &output);
 
-    let command = self.ds().gss(
-      "library-add --lib wikimedia chess-blue-?"
+    let added = self.some_library_add(
+      &G("library-add --lib wikimedia chess-blue-?")
     )?;
-    let added = self.some_library_add(&command)?;
     assert_eq!(added.len(), 6);
   }
 
@@ -145,8 +143,7 @@ impl Ctx {
     assert_eq!(b_pieces[b_pawns[1]].pos,
                a_pieces[a_pawns[0]].pos);
 
-    let command = self.ds().gss("reset demo")?;
-    self.otter_resetting(&command)?;
+    self.otter_resetting(&G("reset demo"))?;
   }
 
   #[throws(Explode)]
index 38d4035b4a081f2d3dc47838b38a67594103fa60..647499c6d0f40d8d254ec097561c574f37b91c64 100644 (file)
@@ -627,9 +627,8 @@ impl UsualCtx {
   
   #[throws(Explode)]
   pub fn clear_reset_to_demo(&mut self) {
-    let ds = self.su().ds.clone();
-    self.otter_resetting(&ds.gss("clear-game")?)?;
-    self.otter_resetting(&ds.gss("reset demo")?)?;
+    self.otter_resetting(&G("clear-game"))?;
+    self.otter_resetting(&G("reset demo"))?;
   }
 }