@@ -31,6 +31,30 @@ function History_Tests(hist)
3131 call assert_equal (' ls' , histget (a: hist , -1 ))
3232 call assert_equal (4 , histnr (a: hist ))
3333
34+ let a = execute (' history ' . a: hist )
35+ call assert_match (" ^\n # \\ S* history\n 3 buffers\n > 4 ls$" , a )
36+ let a = execute (' history all' )
37+ call assert_match (" ^\n # .* history\n 3 buffers\n > 4 ls" , a )
38+
39+ if len (a: hist ) > 0
40+ let a = execute (' history ' . a: hist . ' 2' )
41+ call assert_match (" ^\n # \\ S* history$" , a )
42+ let a = execute (' history ' . a: hist . ' 3' )
43+ call assert_match (" ^\n # \\ S* history\n 3 buffers$" , a )
44+ let a = execute (' history ' . a: hist . ' 4' )
45+ call assert_match (" ^\n # \\ S* history\n > 4 ls$" , a )
46+ let a = execute (' history ' . a: hist . ' 3,4' )
47+ call assert_match (" ^\n # \\ S* history\n 3 buffers\n > 4 ls$" , a )
48+ let a = execute (' history ' . a: hist . ' -1' )
49+ call assert_match (" ^\n # \\ S* history\n > 4 ls$" , a )
50+ let a = execute (' history ' . a: hist . ' -2' )
51+ call assert_match (" ^\n # \\ S* history\n 3 buffers$" , a )
52+ let a = execute (' history ' . a: hist . ' -2,' )
53+ call assert_match (" ^\n # \\ S* history\n 3 buffers\n > 4 ls$" , a )
54+ let a = execute (' history ' . a: hist . ' -3' )
55+ call assert_match (" ^\n # \\ S* history$" , a )
56+ endif
57+
3458 " Test for removing entries matching a pattern
3559 for i in range (1 , 3 )
3660 call histadd (a: hist , ' text_' . i )
0 commit comments