summaryrefslogtreecommitdiff
path: root/src/testdir/test_quickfix.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-16 16:54:24 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-16 16:54:24 +0200
commitf6acffbe83e622542d9fdf3066f51933e46e4954 (patch)
tree70664752ad37e9760fa63ce2c0f432896022628c /src/testdir/test_quickfix.vim
parenta06ecab7a5159e744448ace731036f0dc5f87dd4 (diff)
downloadvim-git-f6acffbe83e622542d9fdf3066f51933e46e4954.tar.gz
patch 7.4.2049v7.4.2049
Problem: There is no way to get a list of the error lists. Solution: Add ":chistory" and ":lhistory".
Diffstat (limited to 'src/testdir/test_quickfix.vim')
-rw-r--r--src/testdir/test_quickfix.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 39f788e4f..9fbef15f8 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -1438,3 +1438,27 @@ function Test_cbottom()
call XbottomTests('c')
call XbottomTests('l')
endfunction
+
+function HistoryTest(cchar)
+ call s:setup_commands(a:cchar)
+
+ call assert_fails(a:cchar . 'older 99', 'E380:')
+ " clear all lists after the first one, then replace the first one.
+ call g:Xsetlist([])
+ Xolder
+ let entry = {'filename': 'foo', 'lnum': 42}
+ call g:Xsetlist([entry], 'r')
+ call g:Xsetlist([entry, entry])
+ call g:Xsetlist([entry, entry, entry])
+ let res = split(execute(a:cchar . 'hist'), "\n")
+ call assert_equal(3, len(res))
+ let common = 'errors :set' . (a:cchar == 'c' ? 'qf' : 'loc') . 'list()'
+ call assert_equal(' error list 1 of 3; 1 ' . common, res[0])
+ call assert_equal(' error list 2 of 3; 2 ' . common, res[1])
+ call assert_equal('> error list 3 of 3; 3 ' . common, res[2])
+endfunc
+
+func Test_history()
+ call HistoryTest('c')
+ call HistoryTest('l')
+endfunc