Skip to content

Commit

Permalink
working compare
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrc committed Jun 5, 2024
1 parent 33842d1 commit bc5ac00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/compare
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ from pathlib import Path
from sys import argv
left_file, right_file = Path(argv[1]).read_text(), Path(argv[2]).read_text()
out = 0
ignored_keys = ["TRACKID", "EGUID"]
ignored_keys = ["<TRACK", "TRACKID", "EGUID"]

if len(left_file) != len(right_file):
print("Different sizes")
out = 1

# skip project declaration
for left, right in zip(left_file.split()[1:], right_file.split()[1:]):
for left, right in zip(left_file.split("\n")[1:], right_file.split("\n")[1:]):
left, right = left.strip(), right.strip()
if left == right or any(map(lambda x: left.startswith(x), ignored_keys)):
continue
print(f"< {left}\n> {right}")
out = 1

exit(out)
1 change: 1 addition & 0 deletions tests/test
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ for test in *.rks; do
kill $pid
./compare $expected $out
diff_ret=$(echo $?)
echo "Test exit code $diff_ret"
echo Stdout:
cat stdout
echo Stderr:
Expand Down

0 comments on commit bc5ac00

Please sign in to comment.