0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

import glob tests

This commit is contained in:
Radim Marek 2015-12-11 21:47:38 +01:00
parent d56a9a1c5d
commit afbda595f6
4 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,6 @@
glob0.host0 {
dir2 arg1
}
glob0.host1 {
}

View file

@ -0,0 +1,4 @@
glob1.host0 {
dir1
dir2 arg1
}

View file

@ -0,0 +1,3 @@
glob2.host0 {
dir2 arg1
}

View file

@ -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()