diff --git a/context_file_test.go b/context_file_test.go index 47c37852..50cc3c8e 100644 --- a/context_file_test.go +++ b/context_file_test.go @@ -11,7 +11,7 @@ import ( // TestContextFileSimple tests the Context.File() method with a simple case func TestContextFileSimple(t *testing.T) { // Test serving an existing file - testFile := "test_file.txt" + testFile := "testdata/test_file.txt" w := httptest.NewRecorder() c, _ := CreateTestContext(w) c.Request = httptest.NewRequest(http.MethodGet, "/test", nil) diff --git a/context_test.go b/context_test.go index bca9e40b..0985cfce 100644 --- a/context_test.go +++ b/context_test.go @@ -80,7 +80,7 @@ func TestContextFile(t *testing.T) { // Test serving an existing file t.Run("serve existing file", func(t *testing.T) { // Create a temporary test file - testFile := "test_file.txt" + testFile := "testdata/test_file.txt" w := httptest.NewRecorder() c, _ := CreateTestContext(w) @@ -118,7 +118,7 @@ func TestContextFile(t *testing.T) { // Test with HEAD request t.Run("HEAD request", func(t *testing.T) { - testFile := "test_file.txt" + testFile := "testdata/test_file.txt" w := httptest.NewRecorder() c, _ := CreateTestContext(w) @@ -133,7 +133,7 @@ func TestContextFile(t *testing.T) { // Test with Range request t.Run("Range request", func(t *testing.T) { - testFile := "test_file.txt" + testFile := "testdata/test_file.txt" w := httptest.NewRecorder() c, _ := CreateTestContext(w)