mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
library/list.m:
Make split_upto/4 and take_upto/{2,3} abort for N < 0.
tests/hard_coded/take_split_upto.{m,exp}:
Update this test case to test the for new behaviour.
tests/hard_coded/Mmakefile:
Do not run the take_split_upto test case in deep profiling
grades since it now requires catching exceptions to be supported.
NEWS:
Announce the above change.
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
take_upto(int.min_int, []) ===> <<exception>>
|
|
take_upto(int.min_int, [111]) ===> <<exception>>
|
|
take_upto(int.min_int, [111, 222]) ===> <<exception>>
|
|
take_upto(-1, []) ===> <<exception>>
|
|
take_upto(-1, [111]) ===> <<exception>>
|
|
take_upto(-1, [111, 222]) ===> <<exception>>
|
|
take_upto(0, []) ===> []
|
|
take_upto(0, [111]) ===> []
|
|
take_upto(0, [111, 222]) ===> []
|
|
take_upto(1, []) ===> []
|
|
take_upto(1, [111]) ===> [111]
|
|
take_upto(1, [111, 222]) ===> [111]
|
|
take_upto(2, []) ===> []
|
|
take_upto(2, [111]) ===> [111]
|
|
take_upto(2, [111, 222]) ===> [111, 222]
|
|
take_upto(2, [111, 222, 333]) ===> [111, 222]
|
|
take_upto(int.max_int, []) ===> []
|
|
take_upto(int.max_int, [111]) ===> [111]
|
|
take_upto(int.max_int, [111, 222]) ===> [111, 222]
|
|
|
|
split_upto(int.min_int, []) ===> <<exception>>
|
|
split_upto(int.min_int, [111]) ===> <<exception>>
|
|
split_upto(int.min_int, [111, 222]) ===> <<exception>>
|
|
split_upto(-1, []) ===> <<exception>>
|
|
split_upto(-1, [111]) ===> <<exception>>
|
|
split_upto(-1, [111, 222]) ===> <<exception>>
|
|
split_upto(0, []) ===> ([], [])
|
|
split_upto(0, [111]) ===> ([], [111])
|
|
split_upto(0, [111, 222]) ===> ([], [111, 222])
|
|
split_upto(1, []) ===> ([], [])
|
|
split_upto(1, [111]) ===> ([111], [])
|
|
split_upto(1, [111, 222]) ===> ([111], [222])
|
|
split_upto(2, []) ===> ([], [])
|
|
split_upto(2, [111]) ===> ([111], [])
|
|
split_upto(2, [111, 222]) ===> ([111, 222], [])
|
|
split_upto(2, [111, 222, 333]) ===> ([111, 222], [333])
|
|
split_upto(int.max_int, []) ===> ([], [])
|
|
split_upto(int.max_int, [111]) ===> ([111], [])
|
|
split_upto(int.max_int, [111, 222]) ===> ([111, 222], [])
|