comparison src/testdir/test_gui.vim @ 28303:9849df834f1d v8.2.4677

patch 8.2.4677: the Athena GUI support is outdated Commit: https://github.com/vim/vim/commit/0b962e5685edd41b55d5427b894797e725707639 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 3 18:02:37 2022 +0100 patch 8.2.4677: the Athena GUI support is outdated Problem: The Athena GUI support is outdated. Solution: Remove the Athena GUI code.
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Apr 2022 19:15:04 +0200
parents 4190b932e6ca
children fdb18b1122f7
comparison
equal deleted inserted replaced
28302:d81a8f2db704 28303:9849df834f1d
61 endfunc 61 endfunc
62 62
63 func Test_getfontname_with_arg() 63 func Test_getfontname_with_arg()
64 CheckX11BasedGui 64 CheckX11BasedGui
65 65
66 if has('gui_athena') || has('gui_motif') 66 if has('gui_motif')
67 " Invalid font name. The result should be an empty string. 67 " Invalid font name. The result should be an empty string.
68 call assert_equal('', getfontname('notexist')) 68 call assert_equal('', getfontname('notexist'))
69 69
70 " Valid font name. This is usually the real name of 7x13 by default. 70 " Valid font name. This is usually the real name of 7x13 by default.
71 let fname = '-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1' 71 let fname = '-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1'
88 let fname = getfontname() 88 let fname = getfontname()
89 89
90 if has('gui_kde') 90 if has('gui_kde')
91 " 'expected' is the value specified by SetUp() above. 91 " 'expected' is the value specified by SetUp() above.
92 call assert_equal('Courier 10 Pitch/8/-1/5/50/0/0/0/0/0', fname) 92 call assert_equal('Courier 10 Pitch/8/-1/5/50/0/0/0/0/0', fname)
93 elseif has('gui_athena') || has('gui_motif') 93 elseif has('gui_motif')
94 " 'expected' is DFLT_FONT of gui_x11.c or its real name. 94 " 'expected' is DFLT_FONT of gui_x11.c or its real name.
95 let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)' 95 let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)'
96 call assert_match(pat, fname) 96 call assert_match(pat, fname)
97 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') 97 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
98 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c. 98 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c.
374 " Prevent 'guifontset' from canceling 'guifont'. 374 " Prevent 'guifontset' from canceling 'guifont'.
375 let guifontset_saved = &guifontset 375 let guifontset_saved = &guifontset
376 set guifontset= 376 set guifontset=
377 endif 377 endif
378 378
379 if has('gui_athena') || has('gui_motif') 379 if has('gui_motif')
380 " Non-empty font list with invalid font names. 380 " Non-empty font list with invalid font names.
381 " 381 "
382 " This test is twofold: (1) It checks if the command fails as expected 382 " This test is twofold: (1) It checks if the command fails as expected
383 " when there are no loadable fonts found in the list. (2) It checks if 383 " when there are no loadable fonts found in the list. (2) It checks if
384 " 'guifont' remains the same after the command loads none of the fonts 384 " 'guifont' remains the same after the command loads none of the fonts
512 endif 512 endif
513 513
514 let &guifontwide = guifontwide_saved 514 let &guifontwide = guifontwide_saved
515 let &guifont = guifont_saved 515 let &guifont = guifont_saved
516 516
517 elseif has('gui_athena') || has('gui_motif') 517 elseif has('gui_motif')
518 " guifontwide is premised upon the xfontset feature. 518 " guifontwide is premised upon the xfontset feature.
519 if !has('xfontset') 519 if !has('xfontset')
520 let skipped = g:not_supported . 'xfontset' 520 let skipped = g:not_supported . 'xfontset'
521 else 521 else
522 let encoding_saved = &encoding 522 let encoding_saved = &encoding
1278 let bufnrlist = tabpagebuflist(v:lnum) 1278 let bufnrlist = tabpagebuflist(v:lnum)
1279 return bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) 1279 return bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
1280 endfunc 1280 endfunc
1281 1281
1282 func Test_gui_tablabel_tooltip() 1282 func Test_gui_tablabel_tooltip()
1283 CheckNotFeature gui_athena
1284
1285 %bw! 1283 %bw!
1286 " Removing the tabline at the end of this test, reduces the window height by 1284 " Removing the tabline at the end of this test, reduces the window height by
1287 " one. Save and restore it after the test. 1285 " one. Save and restore it after the test.
1288 let save_lines = &lines 1286 let save_lines = &lines
1289 edit one 1287 edit one
1434 call assert_true(test_gui_event("dropfiles", d)) 1432 call assert_true(test_gui_event("dropfiles", d))
1435 endfunc 1433 endfunc
1436 1434
1437 " Test for generating a GUI tabline event to select a tab page 1435 " Test for generating a GUI tabline event to select a tab page
1438 func Test_gui_tabline_event() 1436 func Test_gui_tabline_event()
1439 if has('gui_athena')
1440 throw 'Skipped: tabline is not supported in Athena GUI'
1441 endif
1442
1443 %bw! 1437 %bw!
1444 edit Xfile1 1438 edit Xfile1
1445 tabedit Xfile2 1439 tabedit Xfile2
1446 tabedit Xfile3 1440 tabedit Xfile3
1447 1441
1465 %bw! 1459 %bw!
1466 endfunc 1460 endfunc
1467 1461
1468 " Test for generating a GUI tabline menu event to execute an action 1462 " Test for generating a GUI tabline menu event to execute an action
1469 func Test_gui_tabmenu_event() 1463 func Test_gui_tabmenu_event()
1470 if has('gui_athena')
1471 throw 'Skipped: tabmenu is not supported in Athena GUI'
1472 endif
1473 %bw! 1464 %bw!
1474 1465
1475 " Try to close the last tab page 1466 " Try to close the last tab page
1476 call test_gui_event('tabmenu', #{tabnr: 1, item: 1}) 1467 call test_gui_event('tabmenu', #{tabnr: 1, item: 1})
1477 call feedkeys("y", "Lx!") 1468 call feedkeys("y", "Lx!")