diff options
Diffstat (limited to 'test/test_sort.py')
-rwxr-xr-x | test/test_sort.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/test_sort.py b/test/test_sort.py index 4080b93c..04c8ba10 100755 --- a/test/test_sort.py +++ b/test/test_sort.py @@ -28,15 +28,17 @@ collations = [ ] -def check(test_dir, command_prefix, out_dir, input_path, name): +def check(test_dir, command_prefix, out_dir, input_path, name, flags=None): """Sort a single input in the named order and check the output. - The expected output is assumed to exist at test_dir/NAME.nq. + The expected output is assumed to exist at test_dir/NAME.untyped.nq. """ output_path = os.path.join(out_dir, name + ".nq") result_path = os.path.join(test_dir, name + ".nq") - options = [] if name == "pretty" else ["-c", name] + options = flags if flags is not None else [] + if name not in ["pretty", "untyped"]: + options += ["-c", name] # Randomly add irrelevant options just to cover them if random.choice([True, False]): @@ -68,10 +70,18 @@ def run_tests(test_dir, command_prefix, out_dir): input_trig = os.path.join(test_dir, "input.trig") n_failures = 0 + + # Test all the basic collations, and "pretty" with type first for name in collations: if not check(test_dir, command_prefix, out_dir, input_trig, name): n_failures += 1 + # Test "pretty" without type first + if not check( + test_dir, command_prefix, out_dir, input_trig, "untyped", ["-t"] + ): + n_failures += 1 + return n_failures |