MCPcopy
hub / github.com/gogf/gf / TestTSet_Equal

Function TestTSet_Equal

container/gset/gset_z_unit_t_set_test.go:205–228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203}
204
205func TestTSet_Equal(t *testing.T) {
206 gtest.C(t, func(t *gtest.T) {
207 s1 := gset.NewTSetFrom[int]([]int{1, 2, 3})
208 s2 := gset.NewTSetFrom[int]([]int{1, 2, 3})
209 t.Assert(s1.Equal(s2), true)
210 })
211
212 gtest.C(t, func(t *gtest.T) {
213 s1 := gset.NewTSetFrom[int]([]int{1, 2, 3})
214 s2 := gset.NewTSetFrom[int]([]int{1, 2, 3, 4})
215 t.Assert(s1.Equal(s2), false)
216 })
217
218 gtest.C(t, func(t *gtest.T) {
219 s1 := gset.NewTSetFrom[int]([]int{1, 2, 3})
220 t.Assert(s1.Equal(s1), true)
221 })
222
223 gtest.C(t, func(t *gtest.T) {
224 s1 := gset.NewTSetFrom[int]([]int{1, 2, 3})
225 s2 := gset.NewTSetFrom[int]([]int{1, 2, 4})
226 t.Assert(s1.Equal(s2), false)
227 })
228}
229
230func TestTSet_IsSubsetOf(t *testing.T) {
231 gtest.C(t, func(t *gtest.T) {

Callers

nothing calls this directly

Calls 3

CFunction · 0.92
AssertMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…