File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,22 @@ sleep 60
152152 assert_eq ! ( json[ "done" ] , true ) ;
153153 assert ! ( json[ "judges" ] . as_array( ) . is_some( ) ) ;
154154
155+ let fail_cell = cell. join ( "fail.kdl" ) ;
156+ let fail_spec = std:: fs:: read_to_string ( cell. join ( "cell.kdl" ) ) . unwrap ( )
157+ . replace ( "test -f $CATALOG/worker/DONE" , "test -f $CATALOG/worker/NOPE" ) ;
158+ std:: fs:: write ( & fail_cell, fail_spec) . unwrap ( ) ;
159+ let fail_out = Command :: new ( bin)
160+ . args ( [ "eval" , "--json" ] )
161+ . arg ( & fail_cell)
162+ . env ( "PATH" , & path)
163+ . env_remove ( "CATALOG" ) . env_remove ( "ST_ROOT" ) . env_remove ( "PTY_ROOT" )
164+ . env ( "XDG_STATE_HOME" , tmp. path ( ) . join ( "xdg-fail" ) )
165+ . output ( ) . unwrap ( ) ;
166+ assert ! ( !fail_out. status. success( ) ) ;
167+ let fail_json: serde_json:: Value = serde_json:: from_slice ( & fail_out. stdout ) . expect ( "failed eval report" ) ;
168+ assert_eq ! ( fail_json[ "judges" ] [ 0 ] [ "passed" ] , false ) ;
169+ assert ! ( !String :: from_utf8_lossy( & fail_out. stdout) . contains( "==" ) ) ;
170+
155171 let invalid = Command :: new ( bin)
156172 . args ( [ "eval" , "--json" ] )
157173 . arg ( tmp. path ( ) . join ( "missing.kdl" ) )
You can’t perform that action at this time.
0 commit comments