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:
parent
d56a9a1c5d
commit
afbda595f6
4 changed files with 20 additions and 0 deletions
6
caddy/parse/import_glob0.txt
Normal file
6
caddy/parse/import_glob0.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
glob0.host0 {
|
||||||
|
dir2 arg1
|
||||||
|
}
|
||||||
|
|
||||||
|
glob0.host1 {
|
||||||
|
}
|
4
caddy/parse/import_glob1.txt
Normal file
4
caddy/parse/import_glob1.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
glob1.host0 {
|
||||||
|
dir1
|
||||||
|
dir2 arg1
|
||||||
|
}
|
3
caddy/parse/import_glob2.txt
Normal file
3
caddy/parse/import_glob2.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
glob2.host0 {
|
||||||
|
dir2 arg1
|
||||||
|
}
|
|
@ -329,6 +329,13 @@ func TestParseAll(t *testing.T) {
|
||||||
[]address{{"host1.com", "http"}, {"host2.com", "http"}},
|
[]address{{"host1.com", "http"}, {"host2.com", "http"}},
|
||||||
[]address{{"host3.com", "https"}, {"host4.com", "https"}},
|
[]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)
|
p := testParser(test.input)
|
||||||
blocks, err := p.parseAll()
|
blocks, err := p.parseAll()
|
||||||
|
|
Loading…
Reference in a new issue