Mercurial > vim
comparison src/testdir/test_sort.vim @ 19370:02111977dd05 v8.2.0243
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Commit: https://github.com/vim/vim/commit/9f6277bdde97b7767ded43a0b5a2023eb601b3b7
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 11 22:04:02 2020 +0100
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem: Insufficient code coverage for ex_docmd.c functions.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5618)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 11 Feb 2020 22:15:04 +0100 |
parents | 6fd567c927c0 |
children | fdfe44ac6a1a |
comparison
equal
deleted
inserted
replaced
19369:05c259d4233d | 19370:02111977dd05 |
---|---|
1381 new | 1381 new |
1382 let @/ = '\d\+' | 1382 let @/ = '\d\+' |
1383 call setline(1, ['3b', '1c', '2a']) | 1383 call setline(1, ['3b', '1c', '2a']) |
1384 sort // | 1384 sort // |
1385 call assert_equal(['2a', '3b', '1c'], getline(1, '$')) | 1385 call assert_equal(['2a', '3b', '1c'], getline(1, '$')) |
1386 call test_clear_search_pat() | |
1387 call assert_fails('sort //', 'E35:') | |
1388 close! | 1386 close! |
1387 endfunc | |
1388 | |
1389 " Test for :sort with no last search pattern | |
1390 func Test_sort_with_no_last_search_pat() | |
1391 let lines =<< trim [SCRIPT] | |
1392 call setline(1, ['3b', '1c', '2a']) | |
1393 call assert_fails('sort //', 'E35:') | |
1394 call writefile(v:errors, 'Xresult') | |
1395 qall! | |
1396 [SCRIPT] | |
1397 call writefile(lines, 'Xscript') | |
1398 if RunVim([], [], '--clean -S Xscript') | |
1399 call assert_equal([], readfile('Xresult')) | |
1400 endif | |
1401 call delete('Xscript') | |
1402 call delete('Xresult') | |
1389 endfunc | 1403 endfunc |
1390 | 1404 |
1391 " Test for retaining marks across a :sort | 1405 " Test for retaining marks across a :sort |
1392 func Test_sort_with_marks() | 1406 func Test_sort_with_marks() |
1393 new | 1407 new |