Commit dbb37607 authored by simonmar's avatar simonmar
Browse files

[project @ 2002-07-22 13:31:50 by simonmar]

Add test for List.sortBy being a stable sort.
parent 129e9fef
...@@ -15,6 +15,7 @@ test "enum03" { lang_vtr("-cpp","","") } ...@@ -15,6 +15,7 @@ test "enum03" { lang_vtr("-cpp","","") }
test "enum04" { $expect = "fail" lang_vtr("","","") } test "enum04" { $expect = "fail" lang_vtr("","","") }
test "exceptions001" { lang_vtr("","","") } test "exceptions001" { lang_vtr("","","") }
test "list001" { lang_vtr("","","") } test "list001" { lang_vtr("","","") }
test "list002" { lang_vtr("","","") }
test "memo001" { lang_vtr("-package util","+RTS -A10k -G1 -RTS","") } test "memo001" { lang_vtr("-package util","+RTS -A10k -G1 -RTS","") }
test "memo002" { lang_vtr("-package util","20","") } test "memo002" { lang_vtr("-package util","20","") }
test "packedstring001" { lang_vtr("","","") } test "packedstring001" { lang_vtr("","","") }
......
-- !!! Test that List.sortBy is stable.
import List
main = print (sortBy (\(a,b) (a',b')->compare a a')
([1,1,1,1,1,1,1,1,1,1]`zip`[1..10]))
[(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10)]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment