patch 8.1.1362: code and data in tests can be hard to read
Problem: Code and data in tests can be hard to read.
Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes #4400)
diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim
index e4e7755..6b9dd54 100644
--- a/src/testdir/test_xxd.vim
+++ b/src/testdir/test_xxd.vim
@@ -95,9 +95,13 @@
%d
exe '0r! ' . s:xxd_cmd . ' -i XXDfile'
$d
- let expected = ['unsigned char XXDfile[] = {',
- \ ' 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a', '};',
- \ 'unsigned int XXDfile_len = 11;']
+ let expected =<< trim [CODE]
+ unsigned char XXDfile[] = {
+ 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a
+ };
+ unsigned int XXDfile_len = 11;
+ [CODE]
+
call assert_equal(expected, getline(1,'$'), s:Mess(s:test))
" Test 8: Print C include capitalized
@@ -107,9 +111,12 @@
%d
exe '0r! ' . s:xxd_cmd . ' -i ' . arg . ' XXDfile'
$d
- let expected = ['unsigned char XXDFILE[] = {',
- \ ' 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a', '};',
- \ 'unsigned int XXDFILE_LEN = 11;']
+ let expected =<< trim [CODE]
+ unsigned char XXDFILE[] = {
+ 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a
+ };
+ unsigned int XXDFILE_LEN = 11;
+ [CODE]
call assert_equal(expected, getline(1,'$'), s:Mess(s:test))
endfor