Support switch range cases for floating-point values.

This commit is contained in:
Stephen Chung
2023-02-12 23:20:14 +08:00
parent d0a47d7f66
commit 10089c5cb0
7 changed files with 68 additions and 45 deletions

View File

@@ -50,8 +50,8 @@ fn test_expressions() -> Result<(), Box<EvalAltResult>> {
"
switch x {
0 => 1,
1..10 => 123,
10 => 42,
1..10 => 123,
}
"
)?,
@@ -63,11 +63,11 @@ fn test_expressions() -> Result<(), Box<EvalAltResult>> {
"
switch x {
0 => 1,
10 => 42,
1..10 => {
let y = 123;
y
}
10 => 42,
}
"
)