summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-04-06 15:05:49 -0400
committerGitHub <noreply@github.com>2020-04-06 13:05:49 -0600
commita3cfe437b1d27fa0eb20d112de7c257cb25e4ea7 (patch)
treec240c4c19c8af04fce9c934a894b54c005484ae4 /caddyconfig
parent437d5095a6c9aabbabf900417724e655bd4de234 (diff)
caddyhttp: Support single-line not matcher (#3228)
* caddyhttp: Support single-line not matcher shortcut * caddyhttp: Some tests, I guess
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/httptype_test.go26
1 files changed, 23 insertions, 3 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype_test.go b/caddyconfig/httpcaddyfile/httptype_test.go
index d612cd4..64f0f82 100644
--- a/caddyconfig/httpcaddyfile/httptype_test.go
+++ b/caddyconfig/httpcaddyfile/httptype_test.go
@@ -6,7 +6,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
)
-func TestServerType(t *testing.T) {
+func TestMatcherSyntax(t *testing.T) {
for i, tc := range []struct {
input string
expectWarn bool
@@ -15,7 +15,7 @@ func TestServerType(t *testing.T) {
{
input: `http://localhost
@debug {
- query showdebug=1
+ query showdebug=1
}
`,
expectWarn: false,
@@ -24,12 +24,32 @@ func TestServerType(t *testing.T) {
{
input: `http://localhost
@debug {
- query bad format
+ query bad format
}
`,
expectWarn: false,
expectError: true,
},
+ {
+ input: `http://localhost
+ @debug {
+ not {
+ path /somepath*
+ }
+ }
+ `,
+ expectWarn: false,
+ expectError: false,
+ },
+ {
+ input: `http://localhost
+ @debug {
+ not path /somepath*
+ }
+ `,
+ expectWarn: false,
+ expectError: false,
+ },
} {
adapter := caddyfile.Adapter{