Files
mercury/tests/hard_coded/take_split_upto.exp
Julien Fischer 018d05ea45 Make list.split_upto and list.take_upto abort for N < 0.
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.
2016-06-09 11:36:00 +10:00

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], [])