mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Merge branch 'main' into i4150
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
This commit is contained in:
commit
51c687df54
245 changed files with 2408 additions and 1436 deletions
|
@ -7855,4 +7855,103 @@ mod solve_expr {
|
|||
"[A Str, B Str]*",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_as_u8() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
x : U8
|
||||
x = '.'
|
||||
|
||||
x
|
||||
"#
|
||||
),
|
||||
"U8",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_as_u16() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
x : U16
|
||||
x = '.'
|
||||
|
||||
x
|
||||
"#
|
||||
),
|
||||
"U16",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_as_u32() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
x : U32
|
||||
x = '.'
|
||||
|
||||
x
|
||||
"#
|
||||
),
|
||||
"U32",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_pattern_as_u8() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
f : U8 -> _
|
||||
f = \c ->
|
||||
when c is
|
||||
'.' -> 'A'
|
||||
c1 -> c1
|
||||
|
||||
f
|
||||
"#
|
||||
),
|
||||
"U8 -> U8",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_pattern_as_u16() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
f : U16 -> _
|
||||
f = \c ->
|
||||
when c is
|
||||
'.' -> 'A'
|
||||
c1 -> c1
|
||||
|
||||
f
|
||||
"#
|
||||
),
|
||||
"U16 -> U16",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_char_pattern_as_u32() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
f : U32 -> _
|
||||
f = \c ->
|
||||
when c is
|
||||
'.' -> 'A'
|
||||
c1 -> c1
|
||||
|
||||
f
|
||||
"#
|
||||
),
|
||||
"U32 -> U32",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue