mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
when on 128-bit numbers
This commit is contained in:
parent
d0f1500dad
commit
47bbef30e8
3 changed files with 37 additions and 3 deletions
|
@ -3682,3 +3682,39 @@ fn when_on_decimals() {
|
|||
i64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn when_on_i128() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when 1701411834604692317316873037158841057i128 is
|
||||
1701411834604692317316873037158841057 -> 42
|
||||
32 -> 1
|
||||
64 -> 2
|
||||
_ -> 4
|
||||
"#
|
||||
),
|
||||
42,
|
||||
i64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn when_on_u128() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when 170141183460469231731687303715884105728u128 is
|
||||
170141183460469231731687303715884105728u128 -> 42
|
||||
32 -> 1
|
||||
64 -> 2
|
||||
_ -> 4
|
||||
"#
|
||||
),
|
||||
42,
|
||||
i64
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue