mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Add a crash test to mono
This commit is contained in:
parent
c7ef1668d4
commit
220c8a8e64
2 changed files with 24 additions and 1 deletions
18
crates/compiler/test_mono/generated/crash.txt
Normal file
18
crates/compiler/test_mono/generated/crash.txt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
procedure Test.1 (Test.2):
|
||||||
|
let Test.10 : U8 = 1i64;
|
||||||
|
let Test.11 : U8 = GetTagId Test.2;
|
||||||
|
let Test.12 : Int1 = lowlevel Eq Test.10 Test.11;
|
||||||
|
if Test.12 then
|
||||||
|
let Test.3 : U64 = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||||
|
dec Test.2;
|
||||||
|
ret Test.3;
|
||||||
|
else
|
||||||
|
dec Test.2;
|
||||||
|
let Test.9 : Str = "turns out this was fallible";
|
||||||
|
Crash `#UserApp.9`
|
||||||
|
|
||||||
|
procedure Test.0 ():
|
||||||
|
let Test.13 : U64 = 78i64;
|
||||||
|
let Test.4 : [C Str, C U64] = TagId(1) Test.13;
|
||||||
|
let Test.6 : U64 = CallByName Test.1 Test.4;
|
||||||
|
ret Test.6;
|
|
@ -2035,11 +2035,16 @@ fn recursive_function_and_union_with_inference_hole() {
|
||||||
fn crash() {
|
fn crash() {
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
app "test" provides [getInfallible] to "./platform"
|
app "test" provides [main] to "./platform"
|
||||||
|
|
||||||
getInfallible = \result -> when result is
|
getInfallible = \result -> when result is
|
||||||
Ok x -> x
|
Ok x -> x
|
||||||
_ -> crash "turns out this was fallible"
|
_ -> crash "turns out this was fallible"
|
||||||
|
|
||||||
|
main =
|
||||||
|
x : [Ok U64, Err Str]
|
||||||
|
x = Ok 78
|
||||||
|
getInfallible x
|
||||||
"#
|
"#
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue