Skip to content

Test file handler #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 16, 2025
Merged

Test file handler #146

merged 5 commits into from
May 16, 2025

Conversation

DNEGEL3125
Copy link
Contributor

Add unit tests for cmd/go-judge/rest_executor/file_handler.go

Comment on lines 18 to 22
tempDir, err := os.MkdirTemp("", "test_storage")
if err != nil {
t.Fatalf("Failed to create temp directory: %v", err)
}
defer os.RemoveAll(tempDir) // Clean up after test
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use t.TempDir() to simplify temporary directory

@DNEGEL3125
Copy link
Contributor Author

@criyle Good idea, I will update the code.

@criyle criyle merged commit f52326c into criyle:master May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants