diff options
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_asyncify.py | 2 | ||||
-rw-r--r-- | test/unit/test_features.py | 2 | ||||
-rw-r--r-- | test/unit/utils.py | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/test/unit/test_asyncify.py b/test/unit/test_asyncify.py index 55b198cbb..1010c07c4 100644 --- a/test/unit/test_asyncify.py +++ b/test/unit/test_asyncify.py @@ -29,7 +29,7 @@ class AsyncifyTest(utils.BinaryenTestCase): shared.run_process(shared.WASM_DIS + ['a.wasm', '-o', 'a.wat']) output = shared.run_process(shared.WASM_SHELL + ['a.wat'], capture_output=True).stdout with open(self.input_path('asyncify-pure.txt'), 'r') as f: - self.assertEqual(f.read(), output) + self.assert_equal_ignoring_line_endings(f.read(), output) # test wat input wat = self.input_path('asyncify-pure.wat') diff --git a/test/unit/test_features.py b/test/unit/test_features.py index 3b30595d6..506fd8809 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -354,4 +354,4 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase): '--enable-tail-call', '--enable-reference-types', '--enable-multivalue' - ], p2.stdout.split()) + ], p2.stdout.splitlines()) diff --git a/test/unit/utils.py b/test/unit/utils.py index a9bfc3740..d91141e36 100644 --- a/test/unit/utils.py +++ b/test/unit/utils.py @@ -36,3 +36,10 @@ class BinaryenTestCase(unittest.TestCase): self.assertEqual(p.stderr, '') self.assertEqual(p.stdout.split('\n')[:-1], ['--enable-' + f for f in features]) + + # similar to assertEqual, but while ignoring line ending differences such + # as those between windows and unix + def assert_equal_ignoring_line_endings(self, left, right): + left = left.replace('\r\n', '\n') + right = right.replace('\r\n', '\n') + self.assertEqual(left, right) |