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