changeset 11348:4e5191165707 v8.0.0559

patch 8.0.0559: setting ttytype to xxx does not always fail commit https://github.com/vim/vim/commit/f803a7697808f63949ea26fc256d4c9a8647089e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 9 22:54:13 2017 +0200 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 #1601)
author Christian Brabandt <cb@256bit.org>
date Sun, 09 Apr 2017 23:00:04 +0200
parents 4aae8146c21f
children 1850d2412654
files src/testdir/test_options.vim src/version.c
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -280,10 +280,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
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    559,
+/**/
     558,
 /**/
     557,