Mercurial > vim
diff src/testdir/test_xxd.vim @ 16720:9c90cf08cfa8 v8.1.1362
patch 8.1.1362: code and data in tests can be hard to read
commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 20 22:12:34 2019 +0200
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 https://github.com/vim/vim/issues/4400)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 May 2019 22:15:06 +0200 |
parents | f7b88b1d3350 |
children | f38fcbf343ce |
line wrap: on
line diff
--- a/src/testdir/test_xxd.vim +++ b/src/testdir/test_xxd.vim @@ -95,9 +95,13 @@ func Test_xxd() %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 @@ func Test_xxd() %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