Files
mercury/tests/hard_coded/multi_map_test.exp
Julien Fischer 266c1fac41 Fix a bug reported by Tomas By on mercury-bugs: the behaviour of
Branches: main, 11.07

Fix a bug reported by Tomas By on mercury-bugs: the behaviour of
multi_map.det_update/4 did not match the documentation.

library/multi_map.m:
	Fix the behaviour of det_update/4.

	Add replace/4, a semidet version of det_replace/4.

	Reformat some documentation.

NEWS:
	Announce the above fix and addition.

tests/hard_coded/multi_map_test.{m,exp}:
	Replace the existing test for multi_maps with something a bit
	stronger: in particular check the semantics of update, replace,
	insert and set.
2011-07-12 07:11:06 +00:00

15 lines
542 B
Plaintext

[13, 11]
PASSED: is_empty(EmptyMap) succeeded
PASSED: is_empty(Map) failed
det_insert/4: [1 - [13, 11], 2 - [22], 3 - [34]]
insert/4 (test 1): PASSED: [1 - [13, 11], 2 - [22], 3 - [34]]
insert/4 (test 2) PASSED
det_update/4: [1 - [14, 13, 11], 2 - [22]]
update/4 (test 1): PASSED: [1 - [14, 13, 11], 2 - [22]]
update/4 (test 2): PASSED
det_replace/4: [1 - [561, 562, 563], 2 - [22]]
replace/4 (test 1): PASSED: [1 - [561, 562, 563], 2 - [22]]
replace/4 (test 2): PASSED
set/4 (test 1): [1 - [12]]
set/4 (test 2): [1 - [14, 13, 11], 2 - [22]]