Files
mercury/tests/hard_coded/test_injection.exp
Julien Fischer f89054f165 Use error($pred, "...") in more spots in the standard library.
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.
2019-10-15 17:48:36 +11:00

48 lines
3.0 KiB
Plaintext

Test "is_empty" passed.
Test "not is_empty" passed.
Test "set same" passed.
Test "update new" passed.
Test "forward_search succ 1" passed.
Test "forward_search succ 2" passed.
Test "forward_search fail" passed.
Test "reverse_search succ 1" passed.
Test "reverse_search succ 2" passed.
Test "reverse_search fail" passed.
Test "lookup throw" threw exception: software_error("map.lookup: key not found\n\tKey Type: int\n\tKey Value: 10\n\tValue Type: int")
Test "reverse_lookup throw" threw exception: software_error("map.lookup: key not found\n\tKey Type: int\n\tKey Value: 1\n\tValue Type: int")
Test "keys" passed.
Test "values" passed.
Test "insert fail on key" passed.
Test "insert fail on value 1" passed.
Test "insert fail on value 2" passed.
Test "insert throw on key" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 2\n\tValue Type: int")
Test "insert throw on value 1" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 20\n\tValue Type: int")
Test "insert throw on value 2" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 21\n\tValue Type: int")
Test "update fail on key" passed.
Test "update fail on value 1" passed.
Test "update fail on value 2" passed.
Test "update fail on value 3" passed.
Test "update fail on value 4" passed.
Test "update throw on key" threw exception: software_error("map.det_update: key not found\n\tKey Type: int\n\tKey Value: -1\n\tValue Type: int")
Test "update throw on value 1" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 20\n\tValue Type: int")
Test "update throw on value 2" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 21\n\tValue Type: int")
Test "update throw on value 3" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 30\n\tValue Type: int")
Test "update throw on value 4" threw exception: software_error("map.det_insert: key already present\n\tKey Type: int\n\tKey Value: 31\n\tValue Type: int")
Test "set succeed 1" passed.
Test "set succeed 2" passed.
Test "set succeed 3" passed.
Test "set fail 1" passed.
Test "set fail 2" passed.
Test "set throw 1" threw exception: software_error("injection.det_set: value is already associated with another key")
Test "set throw 2" threw exception: software_error("injection.det_set: value is already associated with another key")
Test "delete_key" passed.
Test "delete_value succ" passed.
Test "delete_value throw" threw exception: software_error("function `injection.delete_value\'/2: value is associated with a key")
Test "merge no overlap" passed.
Test "overlay no overlap" passed.
Test "overlay key overlap" passed.
Test "map_keys injective" passed.
Test "map_keys non-injective" passed.
Test "map_values injective" passed.
Test "map_values non-injective" threw exception: software_error("injection.map_values: merged two values with different keys")