Explorar o código

Add test for quoted long lines.

Jelmer Vernooij %!s(int64=2) %!d(string=hai) anos
pai
achega
6cd45fbaf5
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      dulwich/tests/test_config.py

+ 13 - 0
dulwich/tests/test_config.py

@@ -196,6 +196,19 @@ class ConfigFileTests(TestCase):
         cf = self.from_file(b"[branch.foo] foo = bar\n")
         self.assertEqual(b"bar", cf.get((b"branch", b"foo"), b"foo"))
 
+    def test_quoted_newlines(self):
+        cf = self.from_file(br"""
+[alias]
+  c = '!f() { \
+    printf '[git commit -m \"%s\"]\n' \"$*\" && \
+    git commit -m \"$*\"; \
+  }; f'
+""")
+        self.assertEqual(
+            b'\'!f() { printf \'[git commit -m "%s"]\n\' '
+            b'"$*" && git commit -m "$*"',
+            cf.get((b"alias", ), b"c"))
+
     def test_quoted(self):
         cf = self.from_file(
             b"""[gui]