File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ func (s Set[E]) Difference(s2 Set[E]) Set[E] {
155155// Equal returns true if and only if s1 is equal (as a set) to s2.
156156// Two sets are equal if their membership is identical.
157157func (s Set [E ]) Equal (s2 Set [E ]) bool {
158- return s .Len () == s .Len () && s .IsSuperset (s2 )
158+ return s .Len () == s2 .Len () && s .IsSuperset (s2 )
159159}
160160
161161type sortableSlice [E ordered ] []E
Original file line number Diff line number Diff line change @@ -169,11 +169,17 @@ func TestStringSetEquals(t *testing.T) {
169169 if a .Equal (b ) {
170170 t .Errorf ("Expected to be not-equal: %v vs %v" , a , b )
171171 }
172+ if b .Equal (a ) {
173+ t .Errorf ("Expected to be not-equal: %v vs %v" , b , a )
174+ }
172175
173176 b = New [string ]("1" , "2" , "" )
174177 if a .Equal (b ) {
175178 t .Errorf ("Expected to be not-equal: %v vs %v" , a , b )
176179 }
180+ if b .Equal (a ) {
181+ t .Errorf ("Expected to be not-equal: %v vs %v" , b , a )
182+ }
177183
178184 // Check for equality after mutation
179185 a = New [string ]()
You can’t perform that action at this time.
0 commit comments