aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-01 13:32:12 -0500
committerGitHub <noreply@github.com>2016-12-01 13:32:12 -0500
commit77dceaaeb71a78f3db91bed4264e6b2f63cbfde2 (patch)
tree3c951aa27d7af0e5fc963322b3fa7ccd37a45b56 /src/nvim/testdir
parent6c1d81aef2acee88f61eef5303468063e2c51d9b (diff)
parent909b7d9dea6127632905da3758de3c93fa58896c (diff)
downloadrneovim-77dceaaeb71a78f3db91bed4264e6b2f63cbfde2.tar.gz
rneovim-77dceaaeb71a78f3db91bed4264e6b2f63cbfde2.tar.bz2
rneovim-77dceaaeb71a78f3db91bed4264e6b2f63cbfde2.zip
Merge pull request #5675 from brcolow/vim-7.4.1738
vim-patch:7.4.17[35,38,39]
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_messages.vim40
2 files changed, 41 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim
index d460134fb9..083f57aec1 100644
--- a/src/nvim/testdir/test_alot.vim
+++ b/src/nvim/testdir/test_alot.vim
@@ -9,6 +9,7 @@ source test_expr.vim
source test_expr_utf8.vim
source test_feedkeys.vim
source test_menu.vim
+source test_messages.vim
source test_options.vim
source test_popup.vim
source test_regexp_utf8.vim
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim
new file mode 100644
index 0000000000..188406e440
--- /dev/null
+++ b/src/nvim/testdir/test_messages.vim
@@ -0,0 +1,40 @@
+" Tests for :messages
+
+function Test_messages()
+ let oldmore = &more
+ try
+ set nomore
+ " Avoid the "message maintainer" line.
+ let $LANG = ''
+
+ let arr = map(range(10), '"hello" . v:val')
+ for s in arr
+ echomsg s | redraw
+ endfor
+ let result = ''
+
+ " get last two messages
+ redir => result
+ 2messages | redraw
+ redir END
+ let msg_list = split(result, "\n")
+ call assert_equal(["hello8", "hello9"], msg_list)
+
+ " clear messages without last one
+ 1messages clear
+ redir => result
+ redraw | messages
+ redir END
+ let msg_list = split(result, "\n")
+ call assert_equal(['hello9'], msg_list)
+
+ " clear all messages
+ messages clear
+ redir => result
+ redraw | messages
+ redir END
+ call assert_equal('', result)
+ finally
+ let &more = oldmore
+ endtry
+endfunction