Use ? in tests.
This commit is contained in:
@@ -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")?;
|
||||
|
||||
|
Reference in New Issue
Block a user