test(context): add comprehensive unit tests for Context.File() method (#4307)

* test: add comprehensive unit tests for Context.File() method

- Add TestContextFile with multiple test scenarios in context_test.go
- Add simplified tests in context_file_test.go
- Cover file serving, 404 handling, directory access, HEAD requests, and Range requests
- All tests pass successfully

* fix: resolve gci formatting issues in test files

* fix: correct test file paths and add test file to gin directory

* move test_file.txt to testdata directory as suggested by maintainer

* fix: update test file paths to use testdata directory
This commit is contained in:
Leon cap
2025-07-22 21:38:32 +08:00
committed by GitHub
parent 9708475b3b
commit dab5944a7b
3 changed files with 110 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
This is a test file for Context.File() method testing.
It contains some sample content to verify file serving functionality.