MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / TestIsSubsetOf

Function TestIsSubsetOf

structure/set/set_test.go:72–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestIsSubsetOf(t *testing.T) {
73 s1, s2 := New(1, 2, 3), New(1, 2, 3, 4)
74 if !s1.IsSubsetOf(s2) {
75 t.Errorf("expecting %v to be a subset of %v", s1, s2)
76 }
77 if s2.IsSubsetOf(s1) {
78 t.Errorf("expecting %v not to be a subset of %v", s2, s1)
79 }
80 if s3 := New(1, 2, 5, 6); s1.IsSubsetOf(s3) {
81 t.Errorf("expecting %v not to be a subset of %v", s1, s3)
82 }
83}
84
85func TestIsProperSubsetOf(t *testing.T) {
86 s1, s2 := New(1, 2, 3), New(1, 2, 3, 4)

Callers

nothing calls this directly

Calls 2

NewFunction · 0.70
IsSubsetOfMethod · 0.65

Tested by

no test coverage detected