From 5b4be2ffe15a80d289e19d6f80bb4dbfefddc926 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 15 May 2021 19:20:29 +0100 Subject: [PATCH] bundles: Test shape loading from bundle Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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")?)?; } -- 2.30.2