From 08c121c21a7e429e43e2d51fa4a3d8bd945c5d01 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 16 Feb 2026 21:51:17 +0900 Subject: test(backend): add unit tests for admin handlers and taskqueue Add comprehensive tests for previously untested packages: - admin: middleware auth checks, CRUD handlers for users/games/problems/testcases - taskqueue: task creation, payload serialization, code hash calculation - api: expose SetUserInContext helper for cross-package test support Co-Authored-By: Claude Opus 4.6 --- backend/taskqueue/tasks_test.go | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 backend/taskqueue/tasks_test.go (limited to 'backend/taskqueue/tasks_test.go') diff --git a/backend/taskqueue/tasks_test.go b/backend/taskqueue/tasks_test.go new file mode 100644 index 0000000..5eaaf71 --- /dev/null +++ b/backend/taskqueue/tasks_test.go @@ -0,0 +1,63 @@ +package taskqueue + +import ( + "encoding/json" + "testing" +) + +func TestNewTaskRunTestcase(t *testing.T) { + task, err := newTaskRunTestcase(1, 2, 3, 4, "php", "