summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-15 19:31:28 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-15 19:31:28 +0200
commit248fdb33320641804afed4bdf5dc5cddb1cf64f5 (patch)
treeb89128f084d9674c4cd608a4060dbc049d636138
parente00fdf35d069de4effe07125333bb9ff35b1915d (diff)
patch 8.1.2041: no test for diff mode with syntax highlightingv8.1.2041
Problem: No test for diff mode with syntax highlighting. Solution: Add a test case.
-rw-r--r--src/testdir/dumps/Test_diff_syntax_1.dump20
-rw-r--r--src/testdir/test_diffmode.vim36
-rw-r--r--src/version.c2
3 files changed, 58 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_diff_syntax_1.dump b/src/testdir/dumps/Test_diff_syntax_1.dump
new file mode 100644
index 0000000000..05598ff096
--- /dev/null
+++ b/src/testdir/dumps/Test_diff_syntax_1.dump
@@ -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
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 8280a2cb72..8ad86ada8f 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index bf0d350d7c..370de36a8c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2041,
+/**/
2040,
/**/
2039,