comparison src/testdir/test_normal.vim @ 16419:aebcd20a8a3f v8.1.1214

patch 8.1.1214: old style tests commit https://github.com/vim/vim/commit/c6b37db1ba704455daa8f9e78bc1c2492fb81f40 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 27 18:00:34 2019 +0200 patch 8.1.1214: old style tests Problem: Old style tests. Solution: Move tests from test14 to new style test files. (Yegappan Lakshmanan, closes #4308)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Apr 2019 18:15:05 +0200
parents 4673f22da44d
children 9c90cf08cfa8
comparison
equal deleted inserted replaced
16418:6f2f820a2f95 16419:aebcd20a8a3f
1356 if !has("unix") 1356 if !has("unix")
1357 let &keywordprg = k 1357 let &keywordprg = k
1358 bw! 1358 bw!
1359 return 1359 return
1360 endif 1360 endif
1361 set keywordprg=man\ --pager=cat 1361
1362 if has('mac')
1363 " In MacOS, the option for specifying a pager is different
1364 set keywordprg=man\ -P\ cat
1365 else
1366 set keywordprg=man\ --pager=cat
1367 endif
1362 " Test for using man 1368 " Test for using man
1363 2 1369 2
1364 let a = execute('unsilent norm! K') 1370 let a = execute('unsilent norm! K')
1365 call assert_match("man --pager=cat 'man'", a) 1371 if has('mac')
1372 call assert_match("man -P cat 'man'", a)
1373 else
1374 call assert_match("man --pager=cat 'man'", a)
1375 endif
1366 1376
1367 " clean up 1377 " clean up
1368 let &keywordprg = k 1378 let &keywordprg = k
1369 bw! 1379 bw!
1370 endfunc 1380 endfunc
2557 exe "normal \<C-C>" 2567 exe "normal \<C-C>"
2558 call assert_match("Type :qa! and press <Enter> to abandon all changes and exit Vim", Screenline(&lines)) 2568 call assert_match("Type :qa! and press <Enter> to abandon all changes and exit Vim", Screenline(&lines))
2559 2569
2560 bwipe! 2570 bwipe!
2561 endfunc 2571 endfunc
2572
2573 " Test for '[m', ']m', '[M' and ']M'
2574 " Jumping to beginning and end of methods in Java-like languages
2575 func Test_java_motion()
2576 new
2577 a
2578 Piece of Java
2579 {
2580 tt m1 {
2581 t1;
2582 } e1
2583
2584 tt m2 {
2585 t2;
2586 } e2
2587
2588 tt m3 {
2589 if (x)
2590 {
2591 t3;
2592 }
2593 } e3
2594 }
2595 .
2596
2597 normal gg
2598
2599 normal 2]maA
2600 call assert_equal("\ttt m1 {A", getline('.'))
2601 call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')])
2602
2603 normal j]maB
2604 call assert_equal("\ttt m2 {B", getline('.'))
2605 call assert_equal([7, 9, 16], [line('.'), col('.'), virtcol('.')])
2606
2607 normal ]maC
2608 call assert_equal("\ttt m3 {C", getline('.'))
2609 call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')])
2610
2611 normal [maD
2612 call assert_equal("\ttt m3 {DC", getline('.'))
2613 call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')])
2614
2615 normal k2[maE
2616 call assert_equal("\ttt m1 {EA", getline('.'))
2617 call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')])
2618
2619 normal 3[maF
2620 call assert_equal("{F", getline('.'))
2621 call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')])
2622
2623 normal ]MaG
2624 call assert_equal("\t}G e1", getline('.'))
2625 call assert_equal([5, 3, 10], [line('.'), col('.'), virtcol('.')])
2626
2627 normal j2]MaH
2628 call assert_equal("\t}H e3", getline('.'))
2629 call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')])
2630
2631 normal ]M]M
2632 normal aI
2633 call assert_equal("}I", getline('.'))
2634 call assert_equal([17, 2, 2], [line('.'), col('.'), virtcol('.')])
2635
2636 normal 2[MaJ
2637 call assert_equal("\t}JH e3", getline('.'))
2638 call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')])
2639
2640 normal k[MaK
2641 call assert_equal("\t}K e2", getline('.'))
2642 call assert_equal([9, 3, 10], [line('.'), col('.'), virtcol('.')])
2643
2644 normal 3[MaL
2645 call assert_equal("{LF", getline('.'))
2646 call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')])
2647
2648 close!
2649 endfunc