Skip to content

Commit

Permalink
bench(translator): add another translator (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad authored Mar 31, 2024
1 parent b060b9c commit 63b5d7f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions engine/translator/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ pub fn translate(c: &mut Criterion) {
#[cfg(feature = "rhai")]
{
let engine = Engine::new();
let script = engine
let script_a = engine
.compile("fn translate(input) { [input, \"\", input, false] }")
.unwrap();
translator.register("give_back".to_owned(), script);
let script_b = engine
.compile("fn translate(input) { [input, \"\", input.len().to_string(), false] }")
.unwrap();

translator.register("give_back".to_owned(), script_a);
translator.register("to_length".to_owned(), script_b);
}

// Generates candidates for testing.
Expand Down

0 comments on commit 63b5d7f

Please sign in to comment.