chiark / gitweb /
at-otter: Put the test game back at the end for ad-hoc tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 May 2021 16:55:34 +0000 (17:55 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 May 2021 16:58:48 +0000 (17:58 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs

index 2c591ac2c7e1fc2830a7c1c4104c529138abcff9..541e01650799c3dda741d53dbe115cdf84cc0549 100644 (file)
@@ -703,6 +703,14 @@ impl Ctx {
     let st = Command::new("cmp").args(&[&bundle_file, "00000.zip"]).status()?;
     if ! st.success() { panic!("cmp failed {}", st) }
   }
+
+  #[throws(Explode)]
+  fn put_back(&mut self) {
+    // Put things back for the ad-hoc human tester
+    let su = self.su();
+    prepare_game(&su.ds, &self.prctx, TABLE)?;
+    su.ds.setup_static_users(&mut *su.mgmt_conn.borrow_mut(), default())?;
+  }
 }
 
 #[throws(AE)]
@@ -711,6 +719,7 @@ fn tests(mut c: Ctx) {
   test!(c, "hidden-hand",                   c.hidden_hand()  ?);
   test!(c, "specs",        c.chdir_root(|c| c.specs()        ));
   test!(c, "bundles",                       c.bundles()      ?);
+  test!(c, "put-back",                      c.put_back()     ?);
 }
 
 #[throws(AE)]