]> git.madduck.net Git - etc/vim.git/blobdiff - tests/test_trans.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Report all stacktraces in verbose mode (#3938)
[etc/vim.git] / tests / test_trans.py
index a1666a9c1669b7631db79aeb94478ed0757b0d1a..784e852e12a53f1b47faea654e9a208347a8c2ea 100644 (file)
@@ -1,4 +1,5 @@
 from typing import List, Tuple
 from typing import List, Tuple
+
 from black.trans import iter_fexpr_spans
 
 
 from black.trans import iter_fexpr_spans
 
 
@@ -12,7 +13,7 @@ def test_fexpr_spans() -> None:
         # a glance than only spans
         assert len(spans) == len(expected_slices)
         for (i, j), slice in zip(spans, expected_slices):
         # a glance than only spans
         assert len(spans) == len(expected_slices)
         for (i, j), slice in zip(spans, expected_slices):
-            assert len(string[i:j]) == j - i
+            assert 0 <= i <= j <= len(string)
             assert string[i:j] == slice
 
         assert spans == expected_spans
             assert string[i:j] == slice
 
         assert spans == expected_spans