@@ -1905,6 +1905,39 @@ func TestRunCommand_OutputDirMutualExclusion(t *testing.T) {
19051905 assert .Contains (t , err .Error (), "--output and --output-dir are mutually exclusive" )
19061906}
19071907
1908+ func TestRunCommand_OutputDirSingleSkill (t * testing.T ) {
1909+ resetRunGlobals ()
1910+ defer resetRunGlobals ()
1911+
1912+ specPath := createTestSpec (t , "mock" )
1913+ outDir := filepath .Join (t .TempDir (), "results" )
1914+
1915+ cmd := newRunCommand ()
1916+ cmd .SetArgs ([]string {specPath , "--output-dir" , outDir })
1917+
1918+ err := cmd .Execute ()
1919+ require .NoError (t , err )
1920+
1921+ // Verify output directory was created with a result JSON file
1922+ entries , err := os .ReadDir (outDir )
1923+ require .NoError (t , err )
1924+ require .NotEmpty (t , entries , "expected output files in --output-dir" )
1925+
1926+ // Find and validate the JSON result file
1927+ var found bool
1928+ for _ , e := range entries {
1929+ if filepath .Ext (e .Name ()) == ".json" {
1930+ data , err := os .ReadFile (filepath .Join (outDir , e .Name ()))
1931+ require .NoError (t , err )
1932+ var outcome models.EvaluationOutcome
1933+ require .NoError (t , json .Unmarshal (data , & outcome ))
1934+ assert .Equal (t , "test-eval" , outcome .BenchName )
1935+ found = true
1936+ }
1937+ }
1938+ assert .True (t , found , "expected at least one .json result in output dir" )
1939+ }
1940+
19081941func TestWriteOutputDir_SingleSkill (t * testing.T ) {
19091942 dir := t .TempDir ()
19101943
0 commit comments