Commit | Line | Data |
---|---|---|
ed30eb8d GB |
1 | # SPDX-License-Identifier: GPL-2.0-only |
2 | # | |
3 | # Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com> | |
4 | ||
ed30eb8d | 5 | import re |
5995b304 | 6 | import sys |
ed30eb8d GB |
7 | |
8 | ||
9 | def main(): | |
10 | expected = sys.argv[1] | |
11 | actual = sys.argv[2] | |
f5567ea8 FD |
12 | sorted_expected = "".join(sorted(re.findall(r"\w+|\W+", expected.strip()))) |
13 | sorted_actual = "".join(sorted(re.findall(r"\w+|\W+", actual.strip()))) | |
ed30eb8d GB |
14 | |
15 | if sorted_expected == sorted_actual: | |
16 | status = 0 | |
17 | else: | |
18 | status = 1 | |
19 | ||
20 | sys.exit(status) | |
21 | ||
22 | ||
f5567ea8 | 23 | if __name__ == "__main__": |
ed30eb8d | 24 | main() |