You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
552 B
33 lines
552 B
4 years ago
|
package accessctl
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestFilterNot(t *testing.T) {
|
||
|
runCommitMatchTests(t, []filterCommitMatchTest{
|
||
|
{
|
||
|
descr: "sub-filter does match",
|
||
|
filter: FilterNot{
|
||
|
Filter: Filter{
|
||
|
CommitType: &FilterCommitType{Type: "foo"},
|
||
|
},
|
||
|
},
|
||
|
req: CommitRequest{
|
||
|
Type: "foo",
|
||
|
},
|
||
|
match: false,
|
||
|
},
|
||
|
{
|
||
|
descr: "sub-filter does not match",
|
||
|
filter: FilterNot{
|
||
|
Filter: Filter{
|
||
|
CommitType: &FilterCommitType{Type: "foo"},
|
||
|
},
|
||
|
},
|
||
|
req: CommitRequest{
|
||
|
Type: "bar",
|
||
|
},
|
||
|
match: true,
|
||
|
},
|
||
|
})
|
||
|
}
|