diff options
Diffstat (limited to 'tests/bindings-ubm.rs')
-rw-r--r-- | tests/bindings-ubm.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/bindings-ubm.rs b/tests/bindings-ubm.rs index dc3be19..e4232d1 100644 --- a/tests/bindings-ubm.rs +++ b/tests/bindings-ubm.rs @@ -4,19 +4,24 @@ // there are a large number of them. use regex::RegexBuilder; -use std::collections::HashMap; +use std::path::{Path, PathBuf}; use std::time::SystemTime; -use subplot::{Binding, Bindings, ScenarioStep, StepKind}; +use std::{collections::HashMap, sync::Arc}; +use subplot::{html::Location, Binding, Bindings, ScenarioStep, StepKind}; const N: i32 = 1000; +fn path() -> Arc<Path> { + PathBuf::new().into() +} + #[test] fn bindings_microbenchmark() { let time = SystemTime::now(); let mut texts = vec![]; for i in 0..N { - texts.push(format!("step {}", i)); + texts.push(format!("step {i}")); } let texted = time.elapsed().unwrap(); @@ -24,7 +29,7 @@ fn bindings_microbenchmark() { for t in texts.iter() { re.push(( t, - RegexBuilder::new(&format!("^{}$", t)) + RegexBuilder::new(&format!("^{t}$")) .case_insensitive(false) .build() .unwrap(), @@ -34,7 +39,7 @@ fn bindings_microbenchmark() { let mut toadd = vec![]; for t in texts.iter() { - toadd.push(Binding::new(StepKind::Given, t, false, HashMap::new()).unwrap()); + toadd.push(Binding::new(StepKind::Given, t, false, HashMap::new(), None, path()).unwrap()); } let created = time.elapsed().unwrap(); @@ -43,7 +48,12 @@ fn bindings_microbenchmark() { bindings.add(binding); } let added = time.elapsed().unwrap(); - let step = ScenarioStep::new(StepKind::Given, "given", &format!("step {}", N - 1)); + let step = ScenarioStep::new( + StepKind::Given, + "given", + &format!("step {}", N - 1), + Location::Unknown, + ); bindings.find("", &step).unwrap(); let found = time.elapsed().unwrap(); |