mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +00:00
add List.sort test
This commit is contained in:
parent
0a2a43546c
commit
e2b7056e20
2 changed files with 33 additions and 0 deletions
22
compiler/test_mono/generated/list_sort_asc.txt
Normal file
22
compiler/test_mono/generated/list_sort_asc.txt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
procedure List.28 (#Attr.2, #Attr.3):
|
||||||
|
let List.143 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3;
|
||||||
|
let Bool.14 : Int1 = lowlevel ListIsUnique #Attr.2;
|
||||||
|
if Bool.14 then
|
||||||
|
ret List.143;
|
||||||
|
else
|
||||||
|
decref #Attr.2;
|
||||||
|
ret List.143;
|
||||||
|
|
||||||
|
procedure List.54 (List.98):
|
||||||
|
let List.141 : {} = Struct {};
|
||||||
|
let List.140 : List I64 = CallByName List.28 List.98 List.141;
|
||||||
|
ret List.140;
|
||||||
|
|
||||||
|
procedure Num.46 (#Attr.2, #Attr.3):
|
||||||
|
let Num.273 : U8 = lowlevel NumCompare #Attr.2 #Attr.3;
|
||||||
|
ret Num.273;
|
||||||
|
|
||||||
|
procedure Test.0 ():
|
||||||
|
let Test.2 : List I64 = Array [4i64, 3i64, 2i64, 1i64];
|
||||||
|
let Test.1 : List I64 = CallByName List.54 Test.2;
|
||||||
|
ret Test.1;
|
|
@ -1397,3 +1397,14 @@ fn list_map_closure_owns() {
|
||||||
"#
|
"#
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[mono_test]
|
||||||
|
fn list_sort_asc() {
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
app "test" provides [ out ] to "./platform"
|
||||||
|
|
||||||
|
out = List.sortAsc [ 4,3,2,1 ]
|
||||||
|
"#
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue