comparison src/testdir/test_terminal.vim @ 13541:296d02b0637f v8.0.1644

patch 8.0.1644: terminal API tests still fail commit https://github.com/vim/vim/commit/cf67a509e93167f14c892301e13de14636cedc61 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 25 20:31:32 2018 +0200 patch 8.0.1644: terminal API tests still fail Problem: Terminal API tests still fail. Solution: Explicitly set 'title' in the terminal job. (Ozaki Kiichi, closes #2750)
author Christian Brabandt <cb@256bit.org>
date Sun, 25 Mar 2018 20:45:06 +0200
parents 5f543bce50e8
children 98d832e4e394
comparison
equal deleted inserted replaced
13540:8615a18244bb 13541:296d02b0637f
1027 func Test_terminal_api_drop_newwin() 1027 func Test_terminal_api_drop_newwin()
1028 if !CanRunVimInTerminal() 1028 if !CanRunVimInTerminal()
1029 return 1029 return
1030 endif 1030 endif
1031 call assert_equal(1, winnr('$')) 1031 call assert_equal(1, winnr('$'))
1032 set title
1033 1032
1034 " Use the title termcap entries to output the escape sequence. 1033 " Use the title termcap entries to output the escape sequence.
1035 call writefile([ 1034 call writefile([
1035 \ 'set title',
1036 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"', 1036 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
1037 \ 'let &titlestring = ''["drop","Xtextfile"]''', 1037 \ 'let &titlestring = ''["drop","Xtextfile"]''',
1038 \ 'redraw', 1038 \ 'redraw',
1039 \ "set t_ts=", 1039 \ "set t_ts=",
1040 \ ], 'Xscript') 1040 \ ], 'Xscript')
1044 call assert_true(winnr('$') >= 3) 1044 call assert_true(winnr('$') >= 3)
1045 1045
1046 call StopVimInTerminal(buf) 1046 call StopVimInTerminal(buf)
1047 call delete('Xscript') 1047 call delete('Xscript')
1048 bwipe Xtextfile 1048 bwipe Xtextfile
1049 set title&
1050 endfunc 1049 endfunc
1051 1050
1052 func Test_terminal_api_drop_oldwin() 1051 func Test_terminal_api_drop_oldwin()
1053 if !CanRunVimInTerminal() 1052 if !CanRunVimInTerminal()
1054 return 1053 return
1056 let firstwinid = win_getid() 1055 let firstwinid = win_getid()
1057 split Xtextfile 1056 split Xtextfile
1058 let textfile_winid = win_getid() 1057 let textfile_winid = win_getid()
1059 call assert_equal(2, winnr('$')) 1058 call assert_equal(2, winnr('$'))
1060 call win_gotoid(firstwinid) 1059 call win_gotoid(firstwinid)
1061 set title
1062 1060
1063 " Use the title termcap entries to output the escape sequence. 1061 " Use the title termcap entries to output the escape sequence.
1064 call writefile([ 1062 call writefile([
1063 \ 'set title',
1065 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"', 1064 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
1066 \ 'let &titlestring = ''["drop","Xtextfile"]''', 1065 \ 'let &titlestring = ''["drop","Xtextfile"]''',
1067 \ 'redraw', 1066 \ 'redraw',
1068 \ "set t_ts=", 1067 \ "set t_ts=",
1069 \ ], 'Xscript') 1068 \ ], 'Xscript')
1072 call assert_equal(textfile_winid, win_getid()) 1071 call assert_equal(textfile_winid, win_getid())
1073 1072
1074 call StopVimInTerminal(buf) 1073 call StopVimInTerminal(buf)
1075 call delete('Xscript') 1074 call delete('Xscript')
1076 bwipe Xtextfile 1075 bwipe Xtextfile
1077 set title&
1078 endfunc 1076 endfunc
1079 1077
1080 func TryThis(bufnum, arg) 1078 func TryThis(bufnum, arg)
1081 let g:called_bufnum = a:bufnum 1079 let g:called_bufnum = a:bufnum
1082 let g:called_arg = a:arg 1080 let g:called_arg = a:arg
1084 1082
1085 func Test_terminal_api_call() 1083 func Test_terminal_api_call()
1086 if !CanRunVimInTerminal() 1084 if !CanRunVimInTerminal()
1087 return 1085 return
1088 endif 1086 endif
1089 set title
1090 1087
1091 " Use the title termcap entries to output the escape sequence. 1088 " Use the title termcap entries to output the escape sequence.
1092 call writefile([ 1089 call writefile([
1090 \ 'set title',
1093 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"', 1091 \ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
1094 \ 'let &titlestring = ''["call","TryThis",["hello",123]]''', 1092 \ 'let &titlestring = ''["call","TryThis",["hello",123]]''',
1095 \ 'redraw', 1093 \ 'redraw',
1096 \ "set t_ts=", 1094 \ "set t_ts=",
1097 \ ], 'Xscript') 1095 \ ], 'Xscript')
1102 1100
1103 call StopVimInTerminal(buf) 1101 call StopVimInTerminal(buf)
1104 call delete('Xscript') 1102 call delete('Xscript')
1105 unlet g:called_bufnum 1103 unlet g:called_bufnum
1106 unlet g:called_arg 1104 unlet g:called_arg
1107 set title& 1105 endfunc
1108 endfunc