comparison src/testdir/test_terminal.vim @ 20524:bed30e6b5a09 v8.2.0816

patch 8.2.0816: terminal test fails when compiled with Athena Commit: https://github.com/vim/vim/commit/87202264f8e27f084c0e58f98aeb27fa5c6d5251 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 24 17:23:45 2020 +0200 patch 8.2.0816: terminal test fails when compiled with Athena Problem: Terminal test fails when compiled with Athena. Solution: Do give an error when the GUI is not running. (hint by Dominique Pelle, closes #5928, closes #6132)
author Bram Moolenaar <Bram@vim.org>
date Sun, 24 May 2020 17:30:03 +0200
parents eb8715fac6c3
children c81f61e3b508
comparison
equal deleted inserted replaced
20523:775e169d4cfc 20524:bed30e6b5a09
1007 call assert_fails(cmd, 'E475:') 1007 call assert_fails(cmd, 'E475:')
1008 let cmd = "call term_start('', {'tty_type' : 'abc'})" 1008 let cmd = "call term_start('', {'tty_type' : 'abc'})"
1009 call assert_fails(cmd, 'E475:') 1009 call assert_fails(cmd, 'E475:')
1010 let cmd = "call term_start('', {'term_highlight' : []})" 1010 let cmd = "call term_start('', {'term_highlight' : []})"
1011 call assert_fails(cmd, 'E475:') 1011 call assert_fails(cmd, 'E475:')
1012 if has('gui') 1012 if has('gui') || has('termguicolors')
1013 let cmd = "call term_start('', {'ansi_colors' : 'abc'})" 1013 let cmd = "call term_start('', {'ansi_colors' : 'abc'})"
1014 call assert_fails(cmd, 'E475:') 1014 call assert_fails(cmd, 'E475:')
1015 let cmd = "call term_start('', {'ansi_colors' : [[]]})" 1015 let cmd = "call term_start('', {'ansi_colors' : [[]]})"
1016 call assert_fails(cmd, 'E730:') 1016 call assert_fails(cmd, 'E730:')
1017 let cmd = "call term_start('', {'ansi_colors' : repeat(['blue'], 18)})" 1017 let cmd = "call term_start('', {'ansi_colors' : repeat(['blue'], 18)})"
1018 call assert_fails(cmd, 'E475:') 1018 if has('gui_running') || has('termguicolors')
1019 call assert_fails(cmd, 'E475:')
1020 else
1021 call assert_fails(cmd, 'E254:')
1022 endif
1019 endif 1023 endif
1020 endfunc 1024 endfunc
1021 1025
1022 func Test_terminal_response_to_control_sequence() 1026 func Test_terminal_response_to_control_sequence()
1023 CheckUnix 1027 CheckUnix
2666 endfunc 2670 endfunc
2667 2671
2668 " Test for passing invalid arguments to terminal functions 2672 " Test for passing invalid arguments to terminal functions
2669 func Test_term_func_invalid_arg() 2673 func Test_term_func_invalid_arg()
2670 call assert_fails('let b = term_getaltscreen([])', 'E745:') 2674 call assert_fails('let b = term_getaltscreen([])', 'E745:')
2671 call assert_fails('let p = term_getansicolors([])', 'E745:')
2672 call assert_fails('let a = term_getattr(1, [])', 'E730:') 2675 call assert_fails('let a = term_getattr(1, [])', 'E730:')
2673 call assert_fails('let c = term_getcursor([])', 'E745:') 2676 call assert_fails('let c = term_getcursor([])', 'E745:')
2674 call assert_fails('let l = term_getline([], 1)', 'E745:') 2677 call assert_fails('let l = term_getline([], 1)', 'E745:')
2675 call assert_fails('let l = term_getscrolled([])', 'E745:') 2678 call assert_fails('let l = term_getscrolled([])', 'E745:')
2676 call assert_fails('let s = term_getsize([])', 'E745:') 2679 call assert_fails('let s = term_getsize([])', 'E745:')
2677 call assert_fails('let s = term_getstatus([])', 'E745:') 2680 call assert_fails('let s = term_getstatus([])', 'E745:')
2678 call assert_fails('let s = term_scrape([], 1)', 'E745:') 2681 call assert_fails('let s = term_scrape([], 1)', 'E745:')
2679 call assert_fails('call term_sendkeys([], "a")', 'E745:') 2682 call assert_fails('call term_sendkeys([], "a")', 'E745:')
2680 call assert_fails('call term_setansicolors([], [])', 'E745:')
2681 call assert_fails('call term_setapi([], "")', 'E745:') 2683 call assert_fails('call term_setapi([], "")', 'E745:')
2682 call assert_fails('call term_setrestore([], "")', 'E745:') 2684 call assert_fails('call term_setrestore([], "")', 'E745:')
2683 call assert_fails('call term_setkill([], "")', 'E745:') 2685 call assert_fails('call term_setkill([], "")', 'E745:')
2686 if has('gui') || has('termguicolors')
2687 call assert_fails('let p = term_getansicolors([])', 'E745:')
2688 call assert_fails('call term_setansicolors([], [])', 'E745:')
2689 endif
2684 endfunc 2690 endfunc
2685 2691
2686 " Test for sending various special keycodes to a terminal 2692 " Test for sending various special keycodes to a terminal
2687 func Test_term_keycode_translation() 2693 func Test_term_keycode_translation()
2688 CheckRunVimInTerminal 2694 CheckRunVimInTerminal