diff --git a/tests/runner.py b/tests/runner.py index dab4e93..1f9dda3 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -58,6 +58,13 @@ class Result: expected: str command: list[str] +def unordered_compare(out, expected): + if out == expected: + return True + + out_parts = out.split() + expected_parts = expected.split() + return sorted(out_parts) == sorted(expected_parts) async def test(runner: str, case_: TestCase) -> Result: cmd = [runner, case_['cps']] + case_['args'] @@ -77,7 +84,7 @@ async def test(runner: str, case_: TestCase) -> Result: out = bout.decode().strip() err = berr.decode().strip() - success = proc.returncode == case_.get('returncode', 0) and out == expected + success = proc.returncode == case_.get('returncode', 0) and unordered_compare(out, expected) result = Status.PASS if success else Status.FAIL returncode = proc.returncode except asyncio.TimeoutError: