mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
fix uniqueness tests
This commit is contained in:
parent
9754648280
commit
60a32bcf62
1 changed files with 20 additions and 8 deletions
|
@ -75,7 +75,7 @@ mod solve_uniq_expr {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn float_literal() {
|
fn float_literal() {
|
||||||
infer_eq("0.5", "Attr * F64");
|
infer_eq("0.5", "Attr a F64");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -640,7 +640,7 @@ mod solve_uniq_expr {
|
||||||
(\a -> a) 3.14
|
(\a -> a) 3.14
|
||||||
"#
|
"#
|
||||||
),
|
),
|
||||||
"Attr * F64",
|
"Attr a F64",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1118,7 +1118,7 @@ mod solve_uniq_expr {
|
||||||
infer_eq(
|
infer_eq(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
x : Num.Num Num.Integer
|
x : Num.Num (Num.Integer Num.Signed64)
|
||||||
x = 4
|
x = 4
|
||||||
|
|
||||||
x
|
x
|
||||||
|
@ -1211,7 +1211,7 @@ mod solve_uniq_expr {
|
||||||
{ numIdentity, p, q }
|
{ numIdentity, p, q }
|
||||||
"#
|
"#
|
||||||
),
|
),
|
||||||
"Attr * { numIdentity : Attr Shared (Attr b (Num (Attr a p)) -> Attr b (Num (Attr a p))), p : Attr * (Num (Attr * p)), q : Attr * F64 }"
|
"Attr * { numIdentity : Attr Shared (Attr b (Num (Attr a p)) -> Attr b (Num (Attr a p))), p : Attr * (Num (Attr * p)), q : Attr c F64 }"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1368,7 +1368,7 @@ mod solve_uniq_expr {
|
||||||
infer_eq(
|
infer_eq(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
x : Num.Num Num.Integer
|
x : I64
|
||||||
x =
|
x =
|
||||||
when 2 is
|
when 2 is
|
||||||
3 -> 4
|
3 -> 4
|
||||||
|
@ -1816,7 +1816,7 @@ mod solve_uniq_expr {
|
||||||
infer_eq(
|
infer_eq(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
{ x, y } : { x : Str.Str, y : Num.Num Num.FloatingPoint }
|
{ x, y } : { x : Str.Str, y : F64 }
|
||||||
{ x, y } = { x : "foo", y : 3.14 }
|
{ x, y } = { x : "foo", y : 3.14 }
|
||||||
|
|
||||||
x
|
x
|
||||||
|
@ -2662,7 +2662,7 @@ mod solve_uniq_expr {
|
||||||
f
|
f
|
||||||
"#
|
"#
|
||||||
),
|
),
|
||||||
"Attr * (Attr a I64, Attr b I64 -> Attr c I64)",
|
"Attr * (Attr b I64, Attr c I64 -> Attr d I64)",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3159,4 +3159,16 @@ mod solve_uniq_expr {
|
||||||
"Attr a I64",
|
"Attr a I64",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn list_set_out_of_bounds() {
|
||||||
|
infer_eq(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
List.set [1] 1337 0.1
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
"Attr a I64",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue