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

Function TestIntSetApplyFunc

pkg/set/set_test.go:177–189  ·  view source on GitHub ↗

Test ApplyFunc()

(t *testing.T)

Source from the content-addressed store, hash-verified

175
176// Test ApplyFunc()
177func TestIntSetApplyFunc(t *testing.T) {
178 s := Create(1, 2, 3)
179
180 // Double each value
181 result := s.ApplyFunc(func(val int) int {
182 return val * 2
183 })
184
185 expected := Create(2, 4, 6)
186 if !result.Equals(expected) {
187 t.Fatalf("expected doubled values {2, 4, 6}, got: %v", result)
188 }
189}
190
191// Test with different comparable types
192func TestFloat64Set(t *testing.T) {

Callers

nothing calls this directly

Calls 3

CreateFunction · 0.85
ApplyFuncMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected