@@ -210,7 +210,7 @@ def noOutputFixup():
210210
211211@CmdLine ('v' )
212212def viewAttachedFiles ():
213- """View all files containing output in this directory and below"""
213+ """Sublime edit all files containing output in this directory and below"""
214214 for java in Path ("." ).rglob ("*.java" ):
215215 with java .open () as codefile :
216216 code = codefile .read ()
@@ -227,7 +227,7 @@ def viewAttachedFiles():
227227
228228@CmdLine ('s' )
229229def showJavaFiles ():
230- """Show all java files in this directory and below"""
230+ """Sublime edit all java files in this directory and below"""
231231 for java in Path ("." ).rglob ("*.java" ):
232232 os .system ("subl {}" .format (java ))
233233
@@ -244,6 +244,22 @@ def blankOutputFiles():
244244 if not output .group (1 ).strip ():
245245 print (java )
246246
247+ @CmdLine ('u' )
248+ def unexpectedOutput ():
249+ """Show java files with output where none was expected"""
250+ os .chdir (str (examplePath ))
251+ for java in Path ("." ).rglob ("*.java" ):
252+ with java .open () as codeFile :
253+ if "/* Output: (None) */" in codeFile .read ():
254+ outfile = java .with_name (java .stem + "-output.txt" )
255+ errfile = java .with_name (java .stem + "-erroroutput.txt" )
256+ if outfile .exists ():
257+ if outfile .stat ().st_size :
258+ print ("Unexpected output: {}" .format (java ))
259+ if errfile .exists ():
260+ if errfile .stat ().st_size :
261+ print ("Unexpected error output: {}" .format (java ))
262+
247263@CmdLine ('a' )
248264def attachFiles ():
249265 """Attach standard and error output to all files"""
0 commit comments