mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
parent
77cf60b866
commit
250f4ea046
2 changed files with 59 additions and 18 deletions
|
@ -1212,4 +1212,42 @@ mod test {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_on_opaque_number_type() {
|
||||
run_expect_test(
|
||||
indoc!(
|
||||
r#"
|
||||
interface Test exposes [] imports []
|
||||
|
||||
hexToByte : U8, U8 -> U8
|
||||
hexToByte = \upper, lower ->
|
||||
Num.bitwiseOr (Num.shiftRightBy upper 4) lower
|
||||
|
||||
expect
|
||||
actual = hexToByte 7 4
|
||||
expected = 't'
|
||||
actual == expected
|
||||
"#
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
This expectation failed:
|
||||
|
||||
7│> expect
|
||||
8│> actual = hexToByte 7 4
|
||||
9│> expected = 't'
|
||||
10│> actual == expected
|
||||
|
||||
When it failed, these variables had these values:
|
||||
|
||||
actual : U8
|
||||
actual = 4
|
||||
|
||||
expected : Int Unsigned8
|
||||
expected = 116
|
||||
"#
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue