]> git.madduck.net Git - etc/vim.git/commitdiff

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:

Add expected failure tests with the unstable formattings
authorŁukasz Langa <lukasz@langa.pl>
Wed, 26 Aug 2020 10:57:38 +0000 (12:57 +0200)
committerŁukasz Langa <lukasz@langa.pl>
Wed, 26 Aug 2020 14:55:05 +0000 (16:55 +0200)
tests/data/trailing_comma_optional_parens1.py [new file with mode: 0644]
tests/data/trailing_comma_optional_parens2.py [new file with mode: 0644]
tests/data/trailing_comma_optional_parens3.py [new file with mode: 0644]
tests/test_black.py

diff --git a/tests/data/trailing_comma_optional_parens1.py b/tests/data/trailing_comma_optional_parens1.py
new file mode 100644 (file)
index 0000000..5ad29a8
--- /dev/null
@@ -0,0 +1,3 @@
+if e1234123412341234.winerror not in (_winapi.ERROR_SEM_TIMEOUT,
+                        _winapi.ERROR_PIPE_BUSY) or _check_timeout(t):
+    pass
\ No newline at end of file
diff --git a/tests/data/trailing_comma_optional_parens2.py b/tests/data/trailing_comma_optional_parens2.py
new file mode 100644 (file)
index 0000000..2817073
--- /dev/null
@@ -0,0 +1,3 @@
+if (e123456.get_tk_patchlevel() >= (8, 6, 0, 'final') or
+    (8, 5, 8) <= get_tk_patchlevel() < (8, 6)):
+    pass
\ No newline at end of file
diff --git a/tests/data/trailing_comma_optional_parens3.py b/tests/data/trailing_comma_optional_parens3.py
new file mode 100644 (file)
index 0000000..e6a673e
--- /dev/null
@@ -0,0 +1,8 @@
+if True:
+    if True:
+        if True:
+            return _(
+                "qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweas "
+                + "qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqwegqweasdzxcqweasdzxc.",
+                "qweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqweasdzxcqwe",
+            ) % {"reported_username": reported_username, "report_reason": report_reason}
\ No newline at end of file
index cf311f52e14d813de8eff44e6394f9463cd621d9..f5d4e1115a891a63dfc82d636a7377d26209ee13 100644 (file)
@@ -368,6 +368,27 @@ class BlackTestCase(unittest.TestCase):
         black.assert_equivalent(source, actual)
         black.assert_stable(source, actual, DEFAULT_MODE)
 
+    @unittest.expectedFailure
+    @patch("black.dump_to_file", dump_to_stderr)
+    def test_trailing_comma_optional_parens_stability1(self) -> None:
+        source, _expected = read_data("trailing_comma_optional_parens1")
+        actual = fs(source)
+        black.assert_stable(source, actual, DEFAULT_MODE)
+
+    @unittest.expectedFailure
+    @patch("black.dump_to_file", dump_to_stderr)
+    def test_trailing_comma_optional_parens_stability2(self) -> None:
+        source, _expected = read_data("trailing_comma_optional_parens2")
+        actual = fs(source)
+        black.assert_stable(source, actual, DEFAULT_MODE)
+
+    @unittest.expectedFailure
+    @patch("black.dump_to_file", dump_to_stderr)
+    def test_trailing_comma_optional_parens_stability3(self) -> None:
+        source, _expected = read_data("trailing_comma_optional_parens3")
+        actual = fs(source)
+        black.assert_stable(source, actual, DEFAULT_MODE)
+
     @patch("black.dump_to_file", dump_to_stderr)
     def test_expression(self) -> None:
         source, expected = read_data("expression")