Mercurial > vim
comparison src/testdir/test_normal.vim @ 22087:ff21e2962490 v8.2.1593
patch 8.2.1593: tests do not check the error number properly
Commit: https://github.com/vim/vim/commit/e2e4075fad1326181edc5a131e48c644ef613693
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 4 21:18:46 2020 +0200
patch 8.2.1593: tests do not check the error number properly
Problem: Tests do not check the error number properly.0
Solution: Add a colon after the error number. (closes https://github.com/vim/vim/issues/6869)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 04 Sep 2020 21:30:04 +0200 |
parents | e4449560f18d |
children | b3751f4d3b26 |
comparison
equal
deleted
inserted
replaced
22086:0fbcd63c0cc2 | 22087:ff21e2962490 |
---|---|
1263 func Test_normal21_nv_hat() | 1263 func Test_normal21_nv_hat() |
1264 | 1264 |
1265 " Edit a fresh file and wipe the buffer list so that there is no alternate | 1265 " Edit a fresh file and wipe the buffer list so that there is no alternate |
1266 " file present. Next, check for the expected command failures. | 1266 " file present. Next, check for the expected command failures. |
1267 edit Xfoo | %bw | 1267 edit Xfoo | %bw |
1268 call assert_fails(':buffer #', 'E86') | 1268 call assert_fails(':buffer #', 'E86:') |
1269 call assert_fails(':execute "normal! \<C-^>"', 'E23') | 1269 call assert_fails(':execute "normal! \<C-^>"', 'E23:') |
1270 call assert_fails("normal i\<C-R>#", 'E23:') | 1270 call assert_fails("normal i\<C-R>#", 'E23:') |
1271 | 1271 |
1272 " Test for the expected behavior when switching between two named buffers. | 1272 " Test for the expected behavior when switching between two named buffers. |
1273 edit Xfoo | edit Xbar | 1273 edit Xfoo | edit Xbar |
1274 call feedkeys("\<C-^>", 'tx') | 1274 call feedkeys("\<C-^>", 'tx') |
1940 " Test for g; and g, | 1940 " Test for g; and g, |
1941 norm! g; | 1941 norm! g; |
1942 " there is only one change in the changelist | 1942 " there is only one change in the changelist |
1943 " currently, when we setup the window | 1943 " currently, when we setup the window |
1944 call assert_equal(2, line('.')) | 1944 call assert_equal(2, line('.')) |
1945 call assert_fails(':norm! g;', 'E662') | 1945 call assert_fails(':norm! g;', 'E662:') |
1946 call assert_fails(':norm! g,', 'E663') | 1946 call assert_fails(':norm! g,', 'E663:') |
1947 let &ul=&ul | 1947 let &ul=&ul |
1948 call append('$', ['a', 'b', 'c', 'd']) | 1948 call append('$', ['a', 'b', 'c', 'd']) |
1949 let &ul=&ul | 1949 let &ul=&ul |
1950 call append('$', ['Z', 'Y', 'X', 'W']) | 1950 call append('$', ['Z', 'Y', 'X', 'W']) |
1951 let a = execute(':changes') | 1951 let a = execute(':changes') |
2464 | 2464 |
2465 " basic test for drag-n-drop | 2465 " basic test for drag-n-drop |
2466 " unfortunately, without a gui, we can't really test much here, | 2466 " unfortunately, without a gui, we can't really test much here, |
2467 " so simply test that ~p fails (which uses the drop register) | 2467 " so simply test that ~p fails (which uses the drop register) |
2468 new | 2468 new |
2469 call assert_fails(':norm! "~p', 'E353') | 2469 call assert_fails(':norm! "~p', 'E353:') |
2470 call assert_equal([], getreg('~', 1, 1)) | 2470 call assert_equal([], getreg('~', 1, 1)) |
2471 " the ~ register is read only | 2471 " the ~ register is read only |
2472 call assert_fails(':let @~="1"', 'E354') | 2472 call assert_fails(':let @~="1"', 'E354:') |
2473 bw! | 2473 bw! |
2474 endfunc | 2474 endfunc |
2475 | 2475 |
2476 func Test_normal46_ignore() | 2476 func Test_normal46_ignore() |
2477 new | 2477 new |
2508 | 2508 |
2509 func Test_normal48_wincmd() | 2509 func Test_normal48_wincmd() |
2510 new | 2510 new |
2511 exe "norm! \<c-w>c" | 2511 exe "norm! \<c-w>c" |
2512 call assert_equal(1, winnr('$')) | 2512 call assert_equal(1, winnr('$')) |
2513 call assert_fails(":norm! \<c-w>c", "E444") | 2513 call assert_fails(":norm! \<c-w>c", 'E444:') |
2514 endfunc | 2514 endfunc |
2515 | 2515 |
2516 func Test_normal49_counts() | 2516 func Test_normal49_counts() |
2517 new | 2517 new |
2518 call setline(1, 'one two three four five six seven eight nine ten') | 2518 call setline(1, 'one two three four five six seven eight nine ten') |
2529 call assert_equal('[Command Line]', bufname('')) | 2529 call assert_equal('[Command Line]', bufname('')) |
2530 " should fail, with E11, but does fail with E23? | 2530 " should fail, with E11, but does fail with E23? |
2531 "call feedkeys("\<c-^>", 'tm') | 2531 "call feedkeys("\<c-^>", 'tm') |
2532 | 2532 |
2533 " should also fail with E11 | 2533 " should also fail with E11 |
2534 call assert_fails(":wincmd p", 'E11') | 2534 call assert_fails(":wincmd p", 'E11:') |
2535 " return from commandline window | 2535 " return from commandline window |
2536 call feedkeys("\<cr>") | 2536 call feedkeys("\<cr>") |
2537 endfunc | 2537 endfunc |
2538 | 2538 |
2539 let oldlang=v:lang | 2539 let oldlang=v:lang |
2558 call test_settime(1) | 2558 call test_settime(1) |
2559 call writefile(['foo'], 'Xreadonly.log') | 2559 call writefile(['foo'], 'Xreadonly.log') |
2560 new Xreadonly.log | 2560 new Xreadonly.log |
2561 setl ro | 2561 setl ro |
2562 au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix') | 2562 au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix') |
2563 call assert_fails(":norm! Af", 'E788') | 2563 call assert_fails(":norm! Af", 'E788:') |
2564 call assert_equal(['foo'], getline(1,'$')) | 2564 call assert_equal(['foo'], getline(1,'$')) |
2565 call assert_equal('Xreadonly.log', bufname('')) | 2565 call assert_equal('Xreadonly.log', bufname('')) |
2566 | 2566 |
2567 " cleanup | 2567 " cleanup |
2568 call test_settime(0) | 2568 call test_settime(0) |
2699 endfunc | 2699 endfunc |
2700 | 2700 |
2701 func Test_nv_hat_count() | 2701 func Test_nv_hat_count() |
2702 %bwipeout! | 2702 %bwipeout! |
2703 let l:nr = bufnr('%') + 1 | 2703 let l:nr = bufnr('%') + 1 |
2704 call assert_fails(':execute "normal! ' . l:nr . '\<C-^>"', 'E92') | 2704 call assert_fails(':execute "normal! ' . l:nr . '\<C-^>"', 'E92:') |
2705 | 2705 |
2706 edit Xfoo | 2706 edit Xfoo |
2707 let l:foo_nr = bufnr('Xfoo') | 2707 let l:foo_nr = bufnr('Xfoo') |
2708 | 2708 |
2709 edit Xbar | 2709 edit Xbar |