]> granicus.if.org Git - vim/commitdiff
patch 8.1.2041: no test for diff mode with syntax highlighting v8.1.2041
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Sep 2019 17:31:28 +0000 (19:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Sep 2019 17:31:28 +0000 (19:31 +0200)
Problem:    No test for diff mode with syntax highlighting.
Solution:   Add a test case.

src/testdir/dumps/Test_diff_syntax_1.dump [new file with mode: 0644]
src/testdir/test_diffmode.vim
src/version.c

diff --git a/src/testdir/dumps/Test_diff_syntax_1.dump b/src/testdir/dumps/Test_diff_syntax_1.dump
new file mode 100644 (file)
index 0000000..05598ff
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1>v+0#00e0003#ffd7ff255|o|i|d| +0#0000000&|d|o|S+2&#ff404010|o|m|e|t+0&#ffd7ff255|h|i|n|g|(|)| |{| @52
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|;+0#0000000&| @51
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@10|c+0#00e0003&|h|a|r| +0#0000000&|*|s| |=| |"+0#e000002&|t+2&#ff404010|h|e|r|e|"+0&#ffd7ff255|;+0#0000000&| @43
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|5+0#e000002&|;+0#0000000&| @52
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@7|}| @63
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|X+3#0000000&|p|r|o|g|r|a|m|2|.|c| @45|1|,|1| @11|A|l@1
+| +0#0000e05#a8a8a8255@1|v+0#00e0003#ffd7ff255|o|i|d| +0#0000000&|d|o|N+2&#ff404010|o|t+0&#ffd7ff255|h|i|n|g|(|)| |{| @54
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|;+0#0000000&| @51
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@10|c+0#00e0003&|h|a|r| +0#0000000&|*|s| |=| |"+0#e000002&|h+2&#ff404010|e|l@1|o|"+0&#ffd7ff255|;+0#0000000&| @43
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|5+0#e000002&|;+0#0000000&| @52
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@7|}| @63
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|X+1#0000000&|p|r|o|g|r|a|m|1|.|c| @45|1|,|1| @11|A|l@1
+|"+0&&|X|p|r|o|g|r|a|m|2|.|c|"| |5|L|,| |7|6|C| @53
index 8280a2cb726e619b6112d175dd6fe673ad6fa1c1..8ad86ada8f8c872ae8d0cc22595378686981c222 100644 (file)
@@ -905,6 +905,42 @@ func Test_diff_with_cursorline()
   call delete('Xtest_diff_cursorline')
 endfunc
 
+func Test_diff_with_syntax()
+  CheckScreendump
+
+  let lines =<< trim END
+       void doNothing() {
+          int x = 0;
+          char *s = "hello";
+          return 5;
+       }
+  END
+  call writefile(lines, 'Xprogram1.c')
+  let lines =<< trim END
+       void doSomething() {
+          int x = 0;
+          char *s = "there";
+          return 5;
+       }
+  END
+  call writefile(lines, 'Xprogram2.c')
+
+  let lines =<< trim END
+       edit Xprogram1.c
+       diffsplit Xprogram2.c
+  END
+  call writefile(lines, 'Xtest_diff_syntax')
+  let buf = RunVimInTerminal('-S Xtest_diff_syntax', {})
+
+  call VerifyScreenDump(buf, 'Test_diff_syntax_1', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('Xtest_diff_syntax')
+  call delete('Xprogram1.c')
+  call delete('Xprogram2.c')
+endfunc
+
 func Test_diff_of_diff()
   CheckScreendump
   CheckFeature rightleft
index bf0d350d7c68534960728cbafecfa343d6742cfe..370de36a8cbf2038a8bb02ffd453fc5941aa9ba5 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2041,
 /**/
     2040,
 /**/