Use ? in tests.

This commit is contained in:
Stephen Chung
2023-02-13 08:59:58 +08:00
parent 7da20dd090
commit 7fc72e8c28
9 changed files with 41 additions and 57 deletions

View File

@@ -515,14 +515,12 @@ fn test_arrays_map_reduce() -> Result<(), Box<EvalAltResult>> {
3
);
engine
.eval::<()>(
"
engine.eval::<()>(
"
let x = [1, 2, 3, 2, 1];
x.find(|v| v > 4)
",
)
.unwrap();
)?;
assert_eq!(
engine.eval::<INT>(
@@ -534,14 +532,12 @@ fn test_arrays_map_reduce() -> Result<(), Box<EvalAltResult>> {
2
);
engine
.eval::<()>(
"
engine.eval::<()>(
"
let x = [#{alice: 1}, #{bob: 2}, #{clara: 3}];
x.find_map(|v| v.dave)
",
)
.unwrap();
)?;
Ok(())
}
@@ -550,7 +546,7 @@ fn test_arrays_map_reduce() -> Result<(), Box<EvalAltResult>> {
fn test_arrays_elvis() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
engine.eval::<()>("let x = (); x?[2]").unwrap();
engine.eval::<()>("let x = (); x?[2]")?;
engine.run("let x = (); x?[2] = 42")?;