From: Ian Jackson Date: Sat, 15 May 2021 18:20:29 +0000 (+0100) Subject: bundles: Test shape loading from bundle X-Git-Tag: otter-0.6.0~267 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5b4be2ffe15a80d289e19d6f80bb4dbfefddc926;p=otter.git bundles: Test shape loading from bundle Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index df1b40ad..ca7af1b8 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -733,6 +733,18 @@ impl Ctx { let st = Command::new("cmp").args(&[&bundle_file, "00000.zip"]).status()?; if ! st.success() { panic!("cmp failed {}", st) } + let command = ds.ss("library-add @table@ lemon example-lemon")?; + let added = self.some_library_add(&command)?; + assert_eq!( added.len(), 1 ); + + let output: String = self.otter(&ds.ss("list-pieces @table@")?)?.into(); + assert!( Regex::new( + r#"(?m)(?:[^\w-]|^)example-lemon[^\w-].*\Wa lemon(?:\W|$)"# + )? + .find(&output) + .is_some(), + "got: {}", &output); + self.otter(&ds.ss("clear-game @table@")?)?; self.otter(&ds.ss("reset @table@ demo")?)?; }