Skip to content

Commit

Permalink
rename notin operation to not-in
Browse files Browse the repository at this point in the history
  • Loading branch information
lhitchon committed Mar 18, 2018
1 parent 15aecc9 commit e059238
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -180,7 +180,7 @@ Example:
...
```

* notin - Not in list of values
* not-in - Not in list of values

* present - Attribute is present

Expand Down
2 changes: 1 addition & 1 deletion assertion/match.go
Expand Up @@ -66,7 +66,7 @@ func isMatch(data interface{}, op string, value string) bool {
return true
}
}
case "notin":
case "not-in":
for _, v := range strings.Split(value, ",") {
if v == searchResult {
return false
Expand Down
4 changes: 2 additions & 2 deletions assertion/match_test.go
Expand Up @@ -48,8 +48,8 @@ func TestIsMatch(t *testing.T) {
{SearchResult: "Foo", Op: "ne", Value: "Bar", ExpectedResult: true},
{SearchResult: "Foo", Op: "in", Value: "Foo,Bar,Baz", ExpectedResult: true},
{SearchResult: "Foo", Op: "in", Value: "Bar,Baz", ExpectedResult: false},
{SearchResult: "Foo", Op: "notin", Value: "Foo,Bar,Baz", ExpectedResult: false},
{SearchResult: "Foo", Op: "notin", Value: "Bar,Baz", ExpectedResult: true},
{SearchResult: "Foo", Op: "not-in", Value: "Foo,Bar,Baz", ExpectedResult: false},
{SearchResult: "Foo", Op: "not-in", Value: "Bar,Baz", ExpectedResult: true},
{SearchResult: "Foo", Op: "absent", Value: "", ExpectedResult: false},
{SearchResult: "", Op: "absent", Value: "", ExpectedResult: true},
{SearchResult: "null", Op: "absent", Value: "", ExpectedResult: true},
Expand Down

0 comments on commit e059238

Please sign in to comment.