diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-14 23:07:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-14 23:07:30 +0200 |
commit | 3678393baa2fbfcd5020fcf0ac12947fc485e912 (patch) | |
tree | 5429fa1437c38a17b3efe97ed5c8b673fd0f4ead | |
parent | 4fa1019f8026cb383423fb4086cba7e308591e18 (diff) | |
download | vim-git-3678393baa2fbfcd5020fcf0ac12947fc485e912.tar.gz |
patch 8.0.0943: MS-Windows: Test_terminal_scrape_multibyte may failv8.0.0943
Problem: Test_terminal_scrape_multibyte fails if the codepage is not utf-8.
Solution: Start "cmd" with the utf-8 codepage. (micbou, closes #1975)
-rw-r--r-- | src/testdir/test_terminal.vim | 16 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index e77be352f..fe3d7df67 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -185,14 +185,19 @@ func Test_terminal_scrape_multibyte() endif call writefile(["léttまrs"], 'Xtext') if has('win32') - let cmd = 'cmd /c "type Xtext"' + " Run cmd with UTF-8 codepage to make the type command print the expected + " multibyte characters. + let g:buf = term_start("cmd /K chcp 65001") + call term_sendkeys(g:buf, "type Xtext\<CR>") + call term_sendkeys(g:buf, "exit\<CR>") + let g:line = 4 else - let cmd = "cat Xtext" + let g:buf = term_start("cat Xtext") + let g:line = 1 endif - let g:buf = term_start(cmd) - call WaitFor('term_scrape(g:buf, 1)[0].chars == "l"') - let l = term_scrape(g:buf, 1) + call WaitFor('term_scrape(g:buf, g:line)[0].chars == "l"') + let l = term_scrape(g:buf, g:line) call assert_true(len(l) >= 7) call assert_equal('l', l[0].chars) call assert_equal('é', l[1].chars) @@ -210,6 +215,7 @@ func Test_terminal_scrape_multibyte() exe g:buf . 'bwipe' unlet g:buf + unlet g:line call delete('Xtext') endfunc diff --git a/src/version.c b/src/version.c index 263b00492..1bb02a1cc 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 943, +/**/ 942, /**/ 941, |