Closed angeliama98 closed 4 years ago
put_all()
returns a map of the replaced values. You are correct in that a
would be a Map
containing (o1, o3)
after calling put_all(o1, o3)
. But put_all(o1, o3)
returns the replaced values or what was originally in a
. This is equal to c
, a Map
of (o1, o2)
which represent the replaced keys/values after calling put_all(o1, o3)
.
Our tests match out specification that put_all()
should return a map of the replaced key/value pairs.
I hope helps clarify our tests.
a->put(o1, o3); // replaces value in a t_true(b->put_all(a)->equals(c));
So, if we replace value in a with o3, and run b->put_all(a), then we should get a map contains (o1, o3). Whereas, c contains(o1,o2). Therefore, should we have t_false(b->put_all(a)->equals(c)); instead?