Skip to content

Commit 21d7c9b

Browse files
committed
patch 8.0.0289: no test for "ga" and :ascii
Problem: No test for "ga" and :ascii. Solution: Add a test. (Dominique Pelle, closes #1429)
1 parent 4e032e1 commit 21d7c9b

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2127,8 +2127,9 @@ test_arglist \
21272127
test_fnameescape \
21282128
test_fnamemodify \
21292129
test_fold \
2130-
test_glob2regpat \
2130+
test_ga \
21312131
test_gf \
2132+
test_glob2regpat \
21322133
test_gn \
21332134
test_goto \
21342135
test_gui \

src/testdir/test_alot.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ source test_float_func.vim
1919
source test_fnamemodify.vim
2020
source test_functions.vim
2121
source test_glob2regpat.vim
22+
source test_ga.vim
2223
source test_goto.vim
2324
source test_help_tagjump.vim
2425
source test_join.vim

src/testdir/test_ga.vim

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
" Test ga normal command, and :ascii Ex command.
2+
func Do_ga(c)
3+
call setline(1, a:c)
4+
let l:a = execute("norm 1goga")
5+
let l:b = execute("ascii")
6+
call assert_equal(l:a, l:b)
7+
return l:a
8+
endfunc
9+
10+
func Test_ga_command()
11+
new
12+
set display=uhex
13+
call assert_equal("\nNUL", Do_ga(''))
14+
call assert_equal("\n<<01>> 1, Hex 01, Octal 001", Do_ga("\x01"))
15+
call assert_equal("\n<<09>> 9, Hex 09, Octal 011", Do_ga("\t"))
16+
17+
set display=
18+
call assert_equal("\nNUL", Do_ga(''))
19+
call assert_equal("\n<^A> 1, Hex 01, Octal 001", Do_ga("\x01"))
20+
call assert_equal("\n<^I> 9, Hex 09, Octal 011", Do_ga("\t"))
21+
22+
call assert_equal("\n<e> 101, Hex 65, Octal 145", Do_ga('e'))
23+
24+
if !has('multi_byte')
25+
return
26+
endif
27+
28+
" Test a few multi-bytes characters.
29+
call assert_equal("\n<é> 233, Hex 00e9, Octal 351", Do_ga('é'))
30+
call assert_equal("\n<ẻ> 7867, Hex 1ebb, Octal 17273", Do_ga(''))
31+
32+
" Test with combining characters.
33+
call assert_equal("\n<e> 101, Hex 65, Octal 145 < ́> 769, Hex 0301, Octal 1401", Do_ga("e\u0301"))
34+
call assert_equal("\n<e> 101, Hex 65, Octal 145 < ́> 769, Hex 0301, Octal 1401 < ̱> 817, Hex 0331, Octal 1461", Do_ga("e\u0301\u0331"))
35+
call assert_equal("\n<e> 101, Hex 65, Octal 145 < ́> 769, Hex 0301, Octal 1401 < ̱> 817, Hex 0331, Octal 1461 < ̸> 824, Hex 0338, Octal 1470", Do_ga("e\u0301\u0331\u0338"))
36+
bwipe!
37+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
289,
767769
/**/
768770
288,
769771
/**/

0 commit comments

Comments
 (0)