"big-bundle","duped-example", "chess-purple-cannon", "a purple cannon",
&mut |ctx|
{
- let cmd = ctx.su().ds.gss("reset modded-spec")?;
+ let cmd = ctx.ds().gss("reset modded-spec")?;
ctx.reset_game(&cmd)?;
let alice = ctx.connect_player(&ctx.alice)?;
fn reset_with_bundles(&mut self) {
self.clear_reset_to_demo()?;
- let cmd = self.su().ds.gss(
+ let cmd = self.ds().gss(
"reset demo-in-test-bundle @examples@/test-bundle.zip"
)?;
self.reset_game(&cmd)?;
fn library_load(&mut self) {
self.prepare_game()?;
- let command = self.su().ds.gss(
+ let command = self.ds().gss(
"library-list chess-yellow-?"
)?;
let output: String = self.otter(&command)?.into();
.is_some(),
"got: {}", &output);
- let command = self.su().ds.gss(
+ let command = self.ds().gss(
"library-add --lib wikimedia chess-blue-?"
)?;
let added = self.some_library_add(&command)?;
assert_eq!(b_pieces[b_pawns[1]].pos,
a_pieces[a_pawns[0]].pos);
- let command = self.su().ds.gss("reset demo")?;
+ let command = self.ds().gss("reset demo")?;
self.reset_game(&command)?;
}
}
}
let specs = |mid, def| {
- let sv = self.su().ds.also(&[("mid",mid),("def",def)]);
+ let sv = self.ds().also(&[("mid",mid),("def",def)]);
let def = sv.subst("@specs@/@def@.@mid@.toml").unwrap();
let pat = sv.subst("@specs@/*.@mid@.toml").unwrap();
let ents = glob::glob(&pat).unwrap()
let (py, perm) = perms.next();
let (gy, game) = games.next();
if !(py || gy) { break }
- let command = self.su().ds.also(&[("game",&game),("perm",&perm)])
+ let command = self.ds().also(&[("game",&game),("perm",&perm)])
.gss("reset --reset-table @perm@ @game@")?;
self.reset_game(&command).context(perm).context(game)?;
}
impl UsualCtx {
pub fn su(&self) -> std::cell::Ref<SetupCore>{ RefCell::borrow(&self.su_rc) }
pub fn su_mut(&self) -> RefMut<SetupCore> { self.su_rc.borrow_mut() }
+ pub fn ds(&self) -> DirSubst { RefCell::borrow(&self.su_rc).ds.clone() }
pub fn wanted_tests(&self) -> TrackWantedTestsGuard {
TrackWantedTestsGuard(self.su_mut())