Fix switch of non-hashable value.
This commit is contained in:
@@ -18,6 +18,10 @@ fn test_switch() -> Result<(), Box<EvalAltResult>> {
|
||||
engine.eval_with_scope::<()>(&mut scope, "switch x { 1 => 123, 2 => 'a' }")?,
|
||||
()
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<INT>("let x = timestamp(); switch x { 1 => 123, _ => 42 }")?,
|
||||
42
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval_with_scope::<INT>(
|
||||
&mut scope,
|
||||
|
Reference in New Issue
Block a user