Skip to content

Commit

Permalink
Minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Oct 26, 2023
1 parent 6431bb4 commit 002c7f1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/regression.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import os
import subprocess
import sys

ROOT = os.path.dirname(os.path.abspath(__file__))
LANGUAGES = [
Expand Down Expand Up @@ -69,11 +70,17 @@ def main(args):
elif args.check:
assert os.path.isfile(
savefile
), f"Save file for {args.platform}/{compiler}/{path}/{test} does not exist."
), f"Save file for {args.platform}/{compiler[0]}/{path}/{test} does not exist."
with open(savefile, "r") as save:
assert (
save.read() == prompt
), f"Prompt for {args.platform}/{compiler}/{path}/{test} has changed."
saved = save.read()
if saved != prompt:
print(f"Prompt for {args.platform}/{compiler[0]}/{path}/{test} has changed.")
print(f"Saved prompt:")
print(saved)
print()
print("New prompt:")
print(prompt)
sys.exit(1)
else:
assert False, "Unreachable."

Expand Down

0 comments on commit 002c7f1

Please sign in to comment.