Implementation is that two sets are isEqual if they are the same object, or have the same size and B has every element of A.
I did this by duplicating the entire isSubset method and changing the relevant line, rather than first testing for size equality and then delegating to isSubset -- saving operations at the cost of code complexity.
Also have added some test coverage in there. They are largely documentary in that they cover edge cases unlikely to crop up in the current implementation, but which a naïve outsider might like reassurance about (eg that intersecting with an empty set makes an empty set, etc)
Once I've addressed your comments, I can do the same to everything else with isSubset and for other tests.
Addresses #172
Implementation is that two sets are
isEqual
if they are the same object, or have the same size and B has every element of A.I did this by duplicating the entire
isSubset
method and changing the relevant line, rather than first testing for size equality and then delegating toisSubset
-- saving operations at the cost of code complexity.Also have added some test coverage in there. They are largely documentary in that they cover edge cases unlikely to crop up in the current implementation, but which a naïve outsider might like reassurance about (eg that intersecting with an empty set makes an empty set, etc)
Once I've addressed your comments, I can do the same to everything else with isSubset and for other tests.