aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddyconfig/caddyfile/parse_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'caddyconfig/caddyfile/parse_test.go')
-rw-r--r--caddyconfig/caddyfile/parse_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/caddyconfig/caddyfile/parse_test.go b/caddyconfig/caddyfile/parse_test.go
index e3eff5640..4d18cc44f 100644
--- a/caddyconfig/caddyfile/parse_test.go
+++ b/caddyconfig/caddyfile/parse_test.go
@@ -187,6 +187,23 @@ func TestParseOneAndImport(t *testing.T) {
{`import testdata/not_found.txt`, true, []string{}, []int{}},
+ // empty file should just log a warning, and result in no tokens
+ {`import testdata/empty.txt`, false, []string{}, []int{}},
+
+ {`import testdata/only_white_space.txt`, false, []string{}, []int{}},
+
+ // import path/to/dir/* should skip any files that start with a . when iterating over them.
+ {`localhost
+ dir1 arg1
+ import testdata/glob/*`, false, []string{
+ "localhost",
+ }, []int{2, 3, 1}},
+
+ // import path/to/dir/.* should continue to read all dotfiles in a dir.
+ {`import testdata/glob/.*`, false, []string{
+ "host1",
+ }, []int{1, 2}},
+
{`""`, false, []string{}, []int{}},
{``, false, []string{}, []int{}},