Find output that shouldn't be
This commit is contained in:
parent
477c279f8a
commit
ab8f05c8eb
@ -210,7 +210,7 @@ def noOutputFixup():
|
|||||||
|
|
||||||
@CmdLine('v')
|
@CmdLine('v')
|
||||||
def viewAttachedFiles():
|
def viewAttachedFiles():
|
||||||
"""View all files containing output in this directory and below"""
|
"""Sublime edit all files containing output in this directory and below"""
|
||||||
for java in Path(".").rglob("*.java"):
|
for java in Path(".").rglob("*.java"):
|
||||||
with java.open() as codefile:
|
with java.open() as codefile:
|
||||||
code = codefile.read()
|
code = codefile.read()
|
||||||
@ -227,7 +227,7 @@ def viewAttachedFiles():
|
|||||||
|
|
||||||
@CmdLine('s')
|
@CmdLine('s')
|
||||||
def showJavaFiles():
|
def showJavaFiles():
|
||||||
"""Show all java files in this directory and below"""
|
"""Sublime edit all java files in this directory and below"""
|
||||||
for java in Path(".").rglob("*.java"):
|
for java in Path(".").rglob("*.java"):
|
||||||
os.system("subl {}".format(java))
|
os.system("subl {}".format(java))
|
||||||
|
|
||||||
@ -244,6 +244,22 @@ def blankOutputFiles():
|
|||||||
if not output.group(1).strip():
|
if not output.group(1).strip():
|
||||||
print(java)
|
print(java)
|
||||||
|
|
||||||
|
@CmdLine('u')
|
||||||
|
def unexpectedOutput():
|
||||||
|
"""Show java files with output where none was expected"""
|
||||||
|
os.chdir(str(examplePath))
|
||||||
|
for java in Path(".").rglob("*.java"):
|
||||||
|
with java.open() as codeFile:
|
||||||
|
if "/* Output: (None) */" in codeFile.read():
|
||||||
|
outfile = java.with_name(java.stem + "-output.txt")
|
||||||
|
errfile = java.with_name(java.stem + "-erroroutput.txt")
|
||||||
|
if outfile.exists():
|
||||||
|
if outfile.stat().st_size:
|
||||||
|
print("Unexpected output: {}".format(java))
|
||||||
|
if errfile.exists():
|
||||||
|
if errfile.stat().st_size:
|
||||||
|
print("Unexpected error output: {}".format(java))
|
||||||
|
|
||||||
@CmdLine('a')
|
@CmdLine('a')
|
||||||
def attachFiles():
|
def attachFiles():
|
||||||
"""Attach standard and error output to all files"""
|
"""Attach standard and error output to all files"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user