mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 01:04:43 +00:00
Also, throw software_error/1 exceptions rather than directly throwing strings
in a few spots.
Undo special Ralph-style formatting.
library/*.:
As above.
tests/hard_coded/array2d_from_array.exp:
tests/hard_coded/array2d.exp:
tests/hard_coded/test_injection.exp:
Update to conform with the above change.
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
Empty =
|
|
[[]]
|
|
|
|
One =
|
|
[[1]]
|
|
One ^ elem(0, 0) = 1
|
|
|
|
Two =
|
|
[[1, 0]
|
|
[0, 2]]
|
|
Two ^ elem(0, 0) = 1
|
|
Two ^ elem(0, 1) = 0
|
|
Two ^ elem(1, 0) = 0
|
|
Two ^ elem(1, 1) = 2
|
|
|
|
Empty is empty
|
|
One is not empty
|
|
Two is not empty
|
|
|
|
Two_a =
|
|
[[1, 3]
|
|
[0, 2]]
|
|
|
|
Two_b =
|
|
[[1, 3]
|
|
[4, 2]]
|
|
|
|
Zeroes =
|
|
[[0, 0, 0]
|
|
[0, 0, 0]
|
|
[0, 0, 0]]
|
|
|
|
Empty ^ elem(0, 0) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(-1, 0) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(0, -1) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(-1, -1) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(3, 0) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(0, 3) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|
|
Zeroes ^ elem(3, 3) = exception(univ_cons(software_error("function `array2d.elem\'/3: indices out of bounds")))
|