jjones-99 / cs4500-sp2020-a1-part2-jones-tam

Jackie Tam and Jared Jones' work for Assignment 1: Part 2 of Software Development in Spring 2020.
0 stars 2 forks source link

test2: should we have t_false(b->put_all(a)->equals(c)) for the line 68? #20

Closed angeliama98 closed 4 years ago

angeliama98 commented 4 years ago

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?

jsxtam commented 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.