Skip to content

Commit

Permalink
Add multi-filter test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Dec 22, 2023
1 parent ffa2387 commit ac9d56a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions attribute/set_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ func TestFilters(t *testing.T) {
kept: []KeyValue{c},
drop: []KeyValue{a, b},
},
{
name: "A||B",
in: []KeyValue{a, b, c},
fltr: func(kv KeyValue) bool {
return kv.Key == "A" || kv.Key == "B"
},
kept: []KeyValue{a, b},
drop: []KeyValue{c},
},
{
name: "B||C",
in: []KeyValue{a, b, c},
fltr: func(kv KeyValue) bool {
return kv.Key == "B" || kv.Key == "C"
},
kept: []KeyValue{b, c},
drop: []KeyValue{a},
},
{
name: "A||C",
in: []KeyValue{a, b, c},
fltr: func(kv KeyValue) bool {
return kv.Key == "A" || kv.Key == "C"
},
kept: []KeyValue{a, c},
drop: []KeyValue{b},
},
{
name: "All",
in: []KeyValue{a, b, c},
Expand Down

0 comments on commit ac9d56a

Please sign in to comment.