()
| 2 | use std::thread::scope; |
| 3 | |
| 4 | fn main() { |
| 5 | let program = Program::compile("a + b").unwrap(); |
| 6 | |
| 7 | scope(|scope| { |
| 8 | scope.spawn(|| { |
| 9 | let mut context = Context::default(); |
| 10 | context.add_variable("a", 1).unwrap(); |
| 11 | context.add_variable("b", 2).unwrap(); |
| 12 | let value = program.execute(&context).unwrap(); |
| 13 | assert_eq!(value, 3.into()); |
| 14 | }); |
| 15 | scope.spawn(|| { |
| 16 | let mut context = Context::default(); |
| 17 | context.add_variable("a", 2).unwrap(); |
| 18 | context.add_variable("b", 4).unwrap(); |
| 19 | let value = program.execute(&context).unwrap(); |
| 20 | assert_eq!(value, 6.into()); |
| 21 | }); |
| 22 | }); |
| 23 | } |
nothing calls this directly
no test coverage detected