From afbda595f6c031ebb09b013858895167b79803c9 Mon Sep 17 00:00:00 2001 From: Radim Marek Date: Fri, 11 Dec 2015 21:47:38 +0100 Subject: [PATCH] import glob tests --- caddy/parse/import_glob0.txt | 6 ++++++ caddy/parse/import_glob1.txt | 4 ++++ caddy/parse/import_glob2.txt | 3 +++ caddy/parse/parsing_test.go | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 caddy/parse/import_glob0.txt create mode 100644 caddy/parse/import_glob1.txt create mode 100644 caddy/parse/import_glob2.txt diff --git a/caddy/parse/import_glob0.txt b/caddy/parse/import_glob0.txt new file mode 100644 index 00000000..e610b5e7 --- /dev/null +++ b/caddy/parse/import_glob0.txt @@ -0,0 +1,6 @@ +glob0.host0 { + dir2 arg1 +} + +glob0.host1 { +} diff --git a/caddy/parse/import_glob1.txt b/caddy/parse/import_glob1.txt new file mode 100644 index 00000000..111eb044 --- /dev/null +++ b/caddy/parse/import_glob1.txt @@ -0,0 +1,4 @@ +glob1.host0 { + dir1 + dir2 arg1 +} diff --git a/caddy/parse/import_glob2.txt b/caddy/parse/import_glob2.txt new file mode 100644 index 00000000..c09f784e --- /dev/null +++ b/caddy/parse/import_glob2.txt @@ -0,0 +1,3 @@ +glob2.host0 { + dir2 arg1 +} diff --git a/caddy/parse/parsing_test.go b/caddy/parse/parsing_test.go index 97c86808..bda6b29b 100644 --- a/caddy/parse/parsing_test.go +++ b/caddy/parse/parsing_test.go @@ -329,6 +329,13 @@ func TestParseAll(t *testing.T) { []address{{"host1.com", "http"}, {"host2.com", "http"}}, []address{{"host3.com", "https"}, {"host4.com", "https"}}, }}, + + {`import import_glob*.txt`, false, [][]address{ + []address{{"glob0.host0", ""}}, + []address{{"glob0.host1", ""}}, + []address{{"glob1.host0", ""}}, + []address{{"glob2.host0", ""}}, + }}, } { p := testParser(test.input) blocks, err := p.parseAll()