소스 검색

Add test for quoted long lines.

Jelmer Vernooij 2 년 전
부모
커밋
6cd45fbaf5
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  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]