mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 22:40:31 -05:00
fileserver: Add a couple test cases
With placeholders
This commit is contained in:
parent
05a4637489
commit
4e9ad50f65
1 changed files with 12 additions and 0 deletions
|
@ -62,6 +62,12 @@ func TestFileMatcher(t *testing.T) {
|
||||||
expectedType: "file",
|
expectedType: "file",
|
||||||
matched: true,
|
matched: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/foo.txt?a=b",
|
||||||
|
expectedPath: "/foo.txt",
|
||||||
|
expectedType: "file",
|
||||||
|
matched: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/foodir",
|
path: "/foodir",
|
||||||
expectedPath: "/foodir/",
|
expectedPath: "/foodir/",
|
||||||
|
@ -211,6 +217,12 @@ func TestPHPFileMatcher(t *testing.T) {
|
||||||
expectedType: "file",
|
expectedType: "file",
|
||||||
matched: false,
|
matched: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/index.php?path={path}&{query}",
|
||||||
|
expectedPath: "/index.php",
|
||||||
|
expectedType: "file",
|
||||||
|
matched: true,
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
m := &MatchFile{
|
m := &MatchFile{
|
||||||
fileSystem: osFS{},
|
fileSystem: osFS{},
|
||||||
|
|
Loading…
Reference in a new issue