mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 10:42:16 -04:00
httpserver: add not_ends_with (#1688)
* de-duplicates code for 'not' ops and replicates 'not' op for ends_with * fixes incorrect test expectations
This commit is contained in:
committed by
Matt Holt
parent
33e1560d53
commit
474f119702
@@ -38,6 +38,9 @@ func TestConditions(t *testing.T) {
|
||||
{"bab ends_with bb", false},
|
||||
{"bab ends_with bab", true},
|
||||
{"bab ends_with ab", true},
|
||||
{"bab not_ends_with bb", true},
|
||||
{"bab not_ends_with ab", false},
|
||||
{"bab not_ends_with bab", false},
|
||||
{"a match *", false},
|
||||
{"a match a", true},
|
||||
{"a match .*", true},
|
||||
@@ -224,7 +227,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
},
|
||||
{`test {
|
||||
if goal has go
|
||||
if cook not_has go
|
||||
if cook not_has go
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
{a: "goal", op: "has", b: "go"},
|
||||
@@ -233,7 +236,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
}},
|
||||
{`test {
|
||||
if goal has go
|
||||
if cook not_has go
|
||||
if cook not_has go
|
||||
if_op and
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
@@ -243,7 +246,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
}},
|
||||
{`test {
|
||||
if goal has go
|
||||
if cook not_has go
|
||||
if cook not_has go
|
||||
if_op not
|
||||
}`, true, IfMatcher{},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user