Skip to content

Commit 477c279

Browse files
committed
find unexpected blank output
1 parent ed6b8a3 commit 477c279

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

tools/AttachResults.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,28 @@ def viewAttachedFiles():
221221
continue
222222
for n, line in enumerate(code.splitlines()):
223223
if "/* Output:" in line:
224-
os.system("subl {}:{}".format(java, n))
224+
# os.system("subl {}:{}".format(java, n))
225+
os.system("subl {}".format(java))
225226
continue
226227

228+
@CmdLine('s')
229+
def showJavaFiles():
230+
"""Show all java files in this directory and below"""
231+
for java in Path(".").rglob("*.java"):
232+
os.system("subl {}".format(java))
233+
234+
@CmdLine('b')
235+
def blankOutputFiles():
236+
"""Show java files with expected output where there is none"""
237+
find_output = re.compile(r"/\* Output:(.*)\*///:~", re.DOTALL)
238+
os.chdir(str(examplePath))
239+
for java in Path(".").rglob("*.java"):
240+
with java.open() as codeFile:
241+
output = find_output.search(codeFile.read())
242+
if output:
243+
# print(output.group(1))
244+
if not output.group(1).strip():
245+
print(java)
227246

228247
@CmdLine('a')
229248
def attachFiles():

0 commit comments

Comments
 (0)