Browse Source

Add test for quoted long lines.

Jelmer Vernooij 2 years ago
parent
commit
6cd45fbaf5
1 changed files with 13 additions and 0 deletions
  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]