mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
library/array.m:
library/version_array.m:
Add the above predicates.
NEWS:
Announce the new predicates.
tests/hard_coded/Mmakefile:
tests/hard_coded/array_all_tf.{m,exp}:
Test the new predicates.
tests/hard_coded/version_array_test.{m,exp}:
Extend this test case to cover the new predicates.
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
ordering(A1, A0) = '>'
|
|
ordering(A0, A1) = '<'
|
|
ordering(A1, A2) = '<'
|
|
ordering(A2, A1) = '>'
|
|
(size 0)
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (size 10)
|
|
9, 8, 7, 6, 5, 4, 3, 2, 1, 0 (size 10)
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (size 10)
|
|
7, 7, 7, 7, 7, 7, 7 (size 7)
|
|
(sum 49)
|
|
7, 7, 7, 7 (size 4)
|
|
7, 7, 7, 7, 9, 9, 9, 9, 9 (size 9)
|
|
(sum 73)
|
|
7, 7, 7, 7 (size 4)
|
|
Found exception as expected: index_out_of_bounds("version_array.lookup: index -1 not in range [0, 3]")
|
|
Found exception as expected: index_out_of_bounds("version_array.set: index -1 not in range [0, 3]")
|
|
Found exception as expected: index_out_of_bounds("version_array.set: index -1 not in range [0, 3]")
|
|
Found exception as expected: index_out_of_bounds("version_array.lookup: index -1 not in range [0, 3]")
|
|
Found exception as expected: index_out_of_bounds("version_array.lookup: index 4 not in range [0, 3]")
|
|
all_true(int.even A8): passed
|
|
all_false(int.odd, A8): passed
|
|
all_true(int.even, A0): passed
|
|
all_false(int.even, A0): passed
|
|
not all_true(int.odd, A8): passed
|
|
not all_false(int.even, A8): passed
|