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

Function TestIntSetFuncMatch

pkg/set/set_test.go:162–174  ·  view source on GitHub ↗

Test FuncMatch()

(t *testing.T)

Source from the content-addressed store, hash-verified

160
161// Test FuncMatch()
162func TestIntSetFuncMatch(t *testing.T) {
163 s := Create(1, 2, 3, 4, 5, 6)
164
165 // Find all even numbers
166 result := s.FuncMatch(func(val, _ int) bool {
167 return val%2 == 0
168 }, 0)
169
170 expected := Create(2, 4, 6)
171 if !result.Equals(expected) {
172 t.Fatalf("expected even numbers {2, 4, 6}, got: %v", result)
173 }
174}
175
176// Test ApplyFunc()
177func TestIntSetApplyFunc(t *testing.T) {

Callers

nothing calls this directly

Calls 3

CreateFunction · 0.85
FuncMatchMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected