comparison src/testdir/test_startup.vim @ 24140:af489e854955 v8.2.2611

patch 8.2.2611: conditions for startup tests are not exactly right Commit: https://github.com/vim/vim/commit/f8c52e8d08de3fdf48db877d7d53d2d68c6ceb7b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 17 12:27:23 2021 +0100 patch 8.2.2611: conditions for startup tests are not exactly right Problem: Conditions for startup tests are not exactly right. Solution: Check for type of GUI instead of MS-Windows. (Ozaki Kiichi, closes #7976)
author Bram Moolenaar <Bram@vim.org>
date Wed, 17 Mar 2021 12:30:03 +0100
parents 9433e10ce242
children 493870e7f61d
comparison
equal deleted inserted replaced
24139:f65896f473ed 24140:af489e854955
107 call delete('Xtestout') 107 call delete('Xtestout')
108 call delete('Xhere', 'rf') 108 call delete('Xhere', 'rf')
109 endfunc 109 endfunc
110 110
111 func Test_help_arg() 111 func Test_help_arg()
112 if !has('unix') && has('gui_running') 112 " This does not work with a GUI-only binary, such as on MS-Windows.
113 throw 'Skipped: does not work with gvim on MS-Windows' 113 CheckAnyOf Unix NotGui
114 endif
115 114
116 if RunVim([], [], '--help >Xtestout') 115 if RunVim([], [], '--help >Xtestout')
117 let lines = readfile('Xtestout') 116 let lines = readfile('Xtestout')
118 call assert_true(len(lines) > 20) 117 call assert_true(len(lines) > 20)
119 call assert_match('Vi IMproved', lines[0]) 118 call assert_match('Vi IMproved', lines[0])
424 endfunction 423 endfunction
425 424
426 " Test the -reverse and +reverse arguments (for GUI only). 425 " Test the -reverse and +reverse arguments (for GUI only).
427 func Test_reverse() 426 func Test_reverse()
428 CheckCanRunGui 427 CheckCanRunGui
429 CheckNotMSWindows 428 CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena
430 429
431 let after =<< trim [CODE] 430 let after =<< trim [CODE]
432 call writefile([&background], "Xtest_reverse") 431 call writefile([&background], "Xtest_reverse")
433 qall 432 qall
434 [CODE] 433 [CODE]
445 endfunc 444 endfunc
446 445
447 " Test the -background and -foreground arguments (for GUI only). 446 " Test the -background and -foreground arguments (for GUI only).
448 func Test_background_foreground() 447 func Test_background_foreground()
449 CheckCanRunGui 448 CheckCanRunGui
450 CheckNotMSWindows 449 CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena
451 450
452 " Is there a better way to check the effect of -background & -foreground 451 " Is there a better way to check the effect of -background & -foreground
453 " other than merely looking at &background (dark or light)? 452 " other than merely looking at &background (dark or light)?
454 let after =<< trim [CODE] 453 let after =<< trim [CODE]
455 call writefile([&background], "Xtest_fg_bg") 454 call writefile([&background], "Xtest_fg_bg")
494 endfunc 493 endfunc
495 494
496 " Test the -geometry argument (for GUI only). 495 " Test the -geometry argument (for GUI only).
497 func Test_geometry() 496 func Test_geometry()
498 CheckCanRunGui 497 CheckCanRunGui
499 CheckNotMSWindows 498 CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena
500 499
501 if has('gui_motif') || has('gui_athena') 500 if has('gui_motif') || has('gui_athena')
502 " FIXME: With GUI Athena or Motif, the value of getwinposx(), 501 " FIXME: With GUI Athena or Motif, the value of getwinposx(),
503 " getwinposy() and getwinpos() do not match exactly the 502 " getwinposy() and getwinpos() do not match exactly the
504 " value given in -geometry. Why? 503 " value given in -geometry. Why?
526 endfunc 525 endfunc
527 526
528 " Test the -iconic argument (for GUI only). 527 " Test the -iconic argument (for GUI only).
529 func Test_iconic() 528 func Test_iconic()
530 CheckCanRunGui 529 CheckCanRunGui
531 CheckNotMSWindows 530 CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena
532 531
533 call RunVim([], [], '-f -g -iconic -cq') 532 call RunVim([], [], '-f -g -iconic -cq')
534 533
535 " TODO: currently only start vim iconified, but does not 534 " TODO: currently only start vim iconified, but does not
536 " check that vim is iconified. How could this be checked? 535 " check that vim is iconified. How could this be checked?