File tree 2 files changed +7
-1
lines changed
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] {
155
155
// Equal returns true if and only if s1 is equal (as a set) to s2.
156
156
// Two sets are equal if their membership is identical.
157
157
func (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 )
159
159
}
160
160
161
161
type sortableSlice [E ordered ] []E
Original file line number Diff line number Diff line change @@ -169,11 +169,17 @@ func TestStringSetEquals(t *testing.T) {
169
169
if a .Equal (b ) {
170
170
t .Errorf ("Expected to be not-equal: %v vs %v" , a , b )
171
171
}
172
+ if b .Equal (a ) {
173
+ t .Errorf ("Expected to be not-equal: %v vs %v" , b , a )
174
+ }
172
175
173
176
b = New [string ]("1" , "2" , "" )
174
177
if a .Equal (b ) {
175
178
t .Errorf ("Expected to be not-equal: %v vs %v" , a , b )
176
179
}
180
+ if b .Equal (a ) {
181
+ t .Errorf ("Expected to be not-equal: %v vs %v" , b , a )
182
+ }
177
183
178
184
// Check for equality after mutation
179
185
a = New [string ]()
You can’t perform that action at this time.
0 commit comments