summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-14 22:22:03 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-14 22:22:03 +0200
commit03b00476eed43dbc25222549c00b3af28e79b350 (patch)
treec1e46f4ba2f65b1b10770de8e355163e977be49c
parente3a22cb1ba057381be3e645479a537f8032f119f (diff)
patch 8.1.2150: no test for 'ttymouse' set from xterm version responsev8.1.2150
Problem: No test for 'ttymouse' set from xterm version response. Solution: Test the three possible values.
-rw-r--r--src/testdir/test_termcodes.vim39
-rw-r--r--src/version.c2
2 files changed, 39 insertions, 2 deletions
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim
index 1a10d62577..0a4170e38b 100644
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -885,13 +885,12 @@ endfunc
" This checks the libvterm version response.
" This must be after other tests, because it has side effects to xterm
" properties.
-" TODO: check other terminals response
func Test_xx02_libvterm_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
+
set ttymouse=xterm
call test_option_not_set('ttymouse')
-
let seq = "\<Esc>[>0;100;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
@@ -900,6 +899,42 @@ func Test_xx02_libvterm_response()
set t_RV=
endfunc
+" This checks the xterm version response.
+" This must be after other tests, because it has side effects to xterm
+" properties.
+func Test_xx03_xterm_response()
+ " Termresponse is only parsed when t_RV is not empty.
+ set t_RV=x
+
+ " xterm < 95: "xterm" (actually unmodified)
+ set ttymouse=xterm
+ call test_option_not_set('ttymouse')
+ let seq = "\<Esc>[>0;94;0c"
+ call feedkeys(seq, 'Lx!')
+ call assert_equal(seq, v:termresponse)
+ call assert_equal('xterm', &ttymouse)
+
+ " xterm >= 95 < 277 "xterm2"
+ set ttymouse=xterm
+ call test_option_not_set('ttymouse')
+ let seq = "\<Esc>[>0;267;0c"
+ call feedkeys(seq, 'Lx!')
+ call assert_equal(seq, v:termresponse)
+ call assert_equal('xterm2', &ttymouse)
+
+ " xterm >= 277: "sgr"
+ set ttymouse=xterm
+ call test_option_not_set('ttymouse')
+ let seq = "\<Esc>[>0;277;0c"
+ call feedkeys(seq, 'Lx!')
+ call assert_equal(seq, v:termresponse)
+ call assert_equal('sgr', &ttymouse)
+
+ set t_RV=
+endfunc
+
+" TODO: check other terminals response
+
func Test_get_termcode()
try
let k1 = &t_k1
diff --git a/src/version.c b/src/version.c
index 3fc889e91d..a8dc708142 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2150,
+/**/
2149,
/**/
2148,