MCPcopy
hub / github.com/minio/minio-go / TestIntSetCopy

Function TestIntSetCopy

pkg/set/set_test.go:120–133  ·  view source on GitHub ↗

Test Copy()

(t *testing.T)

Source from the content-addressed store, hash-verified

118
119// Test Copy()
120func TestIntSetCopy(t *testing.T) {
121 s1 := Create(1, 2, 3)
122 s2 := Copy(s1)
123
124 if !s1.Equals(s2) {
125 t.Fatalf("expected copy to equal original")
126 }
127
128 // Modify copy and ensure original is unchanged
129 s2.Add(4)
130 if s1.Contains(4) {
131 t.Fatalf("expected original set not to be modified")
132 }
133}
134
135// Test ToSliceOrdered() with integers
136func TestToSliceOrdered(t *testing.T) {

Callers

nothing calls this directly

Calls 5

CreateFunction · 0.85
CopyFunction · 0.85
EqualsMethod · 0.45
AddMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected