Skip to content

Commit

Permalink
Use a directory we are sure to exist for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Jul 15, 2020
1 parent 607743c commit 4cffe1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,16 +754,16 @@ func TestServeFileDirectoryRedirect(t *testing.T) {

ctx.Request.Reset()
ctx.Response.Reset()
ServeFile(&ctx, ".git")
ServeFile(&ctx, "fasthttputil")
if ctx.Response.StatusCode() != StatusFound {
t.Fatalf("Unexpected status code %d for directory '/.git' without trailing slash. Expecting %d.", ctx.Response.StatusCode(), StatusFound)
t.Fatalf("Unexpected status code %d for directory '/fasthttputil' without trailing slash. Expecting %d.", ctx.Response.StatusCode(), StatusFound)
}

ctx.Request.Reset()
ctx.Response.Reset()
ServeFile(&ctx, ".git/")
ServeFile(&ctx, "fasthttputil/")
if ctx.Response.StatusCode() != StatusOK {
t.Fatalf("Unexpected status code %d for directory '/.git/' with trailing slash. Expecting %d.", ctx.Response.StatusCode(), StatusOK)
t.Fatalf("Unexpected status code %d for directory '/fasthttputil/' with trailing slash. Expecting %d.", ctx.Response.StatusCode(), StatusOK)
}

ctx.Request.Reset()
Expand Down

0 comments on commit 4cffe1a

Please sign in to comment.