mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 10:42:16 -04:00
rewrite: treat "if a not_op b" uniformly by negating "op". (#1696)
This commit is contained in:
@@ -201,7 +201,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
if a match b
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
{a: "a", op: "match", b: "b"},
|
||||
{a: "a", op: "match", b: "b", neg: false},
|
||||
},
|
||||
}},
|
||||
{`test {
|
||||
@@ -209,7 +209,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
if_op or
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
{a: "a", op: "match", b: "b"},
|
||||
{a: "a", op: "match", b: "b", neg: false},
|
||||
},
|
||||
isOr: true,
|
||||
}},
|
||||
@@ -230,8 +230,8 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
if cook not_has go
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
{a: "goal", op: "has", b: "go"},
|
||||
{a: "cook", op: "not_has", b: "go"},
|
||||
{a: "goal", op: "has", b: "go", neg: false},
|
||||
{a: "cook", op: "has", b: "go", neg: true},
|
||||
},
|
||||
}},
|
||||
{`test {
|
||||
@@ -240,8 +240,8 @@ func TestSetupIfMatcher(t *testing.T) {
|
||||
if_op and
|
||||
}`, false, IfMatcher{
|
||||
ifs: []ifCond{
|
||||
{a: "goal", op: "has", b: "go"},
|
||||
{a: "cook", op: "not_has", b: "go"},
|
||||
{a: "goal", op: "has", b: "go", neg: false},
|
||||
{a: "cook", op: "has", b: "go", neg: true},
|
||||
},
|
||||
}},
|
||||
{`test {
|
||||
|
||||
Reference in New Issue
Block a user