JOJ3/internal/executor/sandbox/convert_test.go
张泊明518370910136 edbdbd41a8
All checks were successful
build / build (push) Successful in 1m35s
build / trigger-build-image (push) Has been skipped
fix: harden stage execution failures
2026-08-02 00:39:44 -07:00

22 lines
486 B
Go

package sandbox
import (
"strings"
"testing"
"github.com/joint-online-judge/JOJ3/internal/stage"
)
func TestConvertPBCmdReturnsSourceReadError(t *testing.T) {
missing := t.TempDir() + "/missing"
_, err := convertPBCmd([]stage.Cmd{{
Args: []string{"true"},
CopyIn: map[string]stage.CmdFile{
"input": {Src: &missing},
},
}})
if err == nil || !strings.Contains(err.Error(), "read source file") {
t.Fatalf("convertPBCmd() error = %v, want source read error", err)
}
}