aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-05-19 12:30:49 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-05-19 12:46:25 +0200
commitfdd59ef901ad5439fc5f0be4125c67b31d131447 (patch)
treedc161b96f2c2daa282feb4baaff7310e1ec7835d
parent39f16a0fee3c13f587f80db51346d8e3785783ce (diff)
downloadrneovim-fdd59ef901ad5439fc5f0be4125c67b31d131447.tar.gz
rneovim-fdd59ef901ad5439fc5f0be4125c67b31d131447.tar.bz2
rneovim-fdd59ef901ad5439fc5f0be4125c67b31d131447.zip
vim-patch:8.0.0559: setting ttytype to xxx does not always fail
Problem: Setting ttytype to xxx does not always fail as expected. (Marvin Schmidt) Solution: Catch both possible errors. (closes vim/vim#1601) https://github.com/vim/vim/commit/f803a7697808f63949ea26fc256d4c9a8647089e
-rw-r--r--src/nvim/testdir/test_options.vim20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index 738c703b7f..eb42e35bd3 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -238,10 +238,22 @@ func Test_set_ttytype()
set ttytype=xterm
call assert_equal('xterm', &ttytype)
call assert_equal(&ttytype, &term)
- " FIXME: "set ttytype=" gives E522 instead of E529
- " in travis on some builds. Why? Commented out this test for now.
- " call assert_fails('set ttytype=', 'E529:')
- call assert_fails('set ttytype=xxx', 'E522:')
+ " "set ttytype=" gives E522 instead of E529
+ " in travis on some builds. Why? Catch both for now
+ try
+ set ttytype=
+ call assert_report('set ttype= did not fail')
+ catch /E529\|E522/
+ endtry
+
+ " Some systems accept any terminal name and return dumb settings,
+ " check for failure of finding the entry and for missing 'cm' entry.
+ try
+ set ttytype=xxx
+ call assert_report('set ttype=xxx did not fail')
+ catch /E522\|E437/
+ endtry
+
set ttytype&
call assert_equal(&ttytype, &term)
endif