Mercurial > vim
changeset 18092:995925603ea0 v8.1.2041
patch 8.1.2041: no test for diff mode with syntax highlighting
Commit: https://github.com/vim/vim/commit/248fdb33320641804afed4bdf5dc5cddb1cf64f5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 15 19:31:28 2019 +0200
patch 8.1.2041: no test for diff mode with syntax highlighting
Problem: No test for diff mode with syntax highlighting.
Solution: Add a test case.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 Sep 2019 19:45:03 +0200 |
parents | c1ae47339f5c |
children | 18c77f2ec0d9 |
files | src/testdir/dumps/Test_diff_syntax_1.dump src/testdir/test_diffmode.vim src/version.c |
diffstat | 3 files changed, 58 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /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
--- 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