diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-31 07:48:43 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-12-31 07:48:43 -0500 |
commit | a9bc9bfd1179a64839d4908fb8f54e7823ee044e (patch) | |
tree | 122d598cd31bc034a011c7ffa6c4928d2d036237 /tests/test_misc.py | |
parent | 372f411b8ca76f85c0cc6cc4415d5bee2ca948e2 (diff) | |
download | python-coveragepy-git-a9bc9bfd1179a64839d4908fb8f54e7823ee044e.tar.gz |
Easier to decipher arcz output
Diffstat (limited to 'tests/test_misc.py')
-rw-r--r-- | tests/test_misc.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py index 896dbf47..e6b83236 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -5,7 +5,8 @@ import pytest -from coverage.misc import arcz_to_arcs, contract, dummy_decorator_with_args, file_be_gone +from coverage.misc import arcs_to_arcz_repr, arcz_to_arcs +from coverage.misc import contract, dummy_decorator_with_args, file_be_gone from coverage.misc import Hasher, one_of, substitute_variables from coverage.misc import CoverageException, USE_CONTRACTS @@ -167,3 +168,21 @@ def test_substitute_variables_errors(text): ]) def test_arcz_to_arcs(arcz, arcs): assert arcz_to_arcs(arcz) == arcs + + +@pytest.mark.parametrize("arcs, arcz_repr", [ + ([(-1, 1), (1, 2), (2, -1)], "(-1, 1) # .1\n(1, 2) # 12\n(2, -1) # 2.\n"), + ([(-1, 1), (1, 2), (2, -5)], "(-1, 1) # .1\n(1, 2) # 12\n(2, -5) # 2-5\n"), + ([(-26, 10), (12, 11), (18, 29), (35, -10), (1, 33), (100, 7)], + ( + "(-26, 10) # -QA\n" + "(12, 11) # CB\n" + "(18, 29) # IT\n" + "(35, -10) # Z-A\n" + "(1, 33) # 1X\n" + "(100, 7) # ?7\n" + ) + ), +]) +def test_arcs_to_arcz_repr(arcs, arcz_repr): + assert arcs_to_arcz_repr(arcs) == arcz_repr |