Skip to content

Commit c044ba7

Browse files
committed
updated for version 7.4.370
Problem: Linebreak test fails when encoding is not utf-8. (Danek Duvall) Solution: Split the test in a single byte one and a utf-8 one. (Christian Brabandt)
1 parent 7ef920a commit c044ba7

File tree

11 files changed

+74
-32
lines changed

11 files changed

+74
-32
lines changed

src/testdir/Make_amiga.mak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
3939
test_autoformat_join.out \
4040
test_breakindent.out \
4141
test_listlbr.out \
42+
test_listlbr_utf8.out \
4243
test_eval.out \
4344
test_options.out
4445

@@ -167,5 +168,6 @@ test107.out: test107.in
167168
test_autoformat_join.out: test_autoformat_join.in
168169
test_breakindent.out: test_breakindent.in
169170
test_listlbr.out: test_listlbr.in
171+
test_listlbr_utf8.out: test_listlbr_utf8.in
170172
test_eval.out: test_eval.in
171173
test_options.out: test_options.in

src/testdir/Make_dos.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
3838
test_autoformat_join.out \
3939
test_breakindent.out \
4040
test_listlbr.out \
41+
test_listlbr_utf8.out \
4142
test_eval.out \
4243
test_options.out
4344

src/testdir/Make_ming.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
5858
test_autoformat_join.out \
5959
test_breakindent.out \
6060
test_listlbr.out \
61+
test_listlbr_utf8.out \
6162
test_eval.out \
6263
test_options.out
6364

src/testdir/Make_os2.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
4040
test_autoformat_join.out \
4141
test_eval.out \
4242
test_breakindent.out \
43+
test_listlbr_utf8.out \
4344
test_listlbr.out \
4445
test_options.out
4546

src/testdir/Make_vms.mms

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
9999
test_autoformat_join.out \
100100
test_breakindent.out \
101101
test_listlbr.out \
102+
test_listlbr_utf8.out \
102103
test_eval.out \
103104
test_options.out
104105

src/testdir/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
3636
test_autoformat_join.out \
3737
test_breakindent.out \
3838
test_listlbr.out \
39+
test_listlbr_utf8.out \
3940
test_eval.out \
4041
test_options.out
4142

src/testdir/test_listlbr.in

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Test for linebreak and list option
1+
Test for linebreak and list option (non-utf8)
22

33
STARTTEST
44
:so small.vim
55
:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
66
:10new|:vsp|:vert resize 20
7-
:put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \"
7+
:put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
88
:norm! zt
99
:set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
1010
:fu! ScreenChar(width)
@@ -32,22 +32,12 @@ STARTTEST
3232
:redraw!
3333
:let line=ScreenChar(winwidth(0))
3434
:call DoRecordScreen()
35-
:let g:test ="Test 3: set linebreak + set list + fancy listchars"
36-
:exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
37-
:redraw!
38-
:let line=ScreenChar(winwidth(0))
39-
:call DoRecordScreen()
40-
:let g:test ="Test 4: set linebreak nolist"
35+
:let g:test ="Test 3: set linebreak nolist"
4136
:set nolist linebreak
4237
:redraw!
4338
:let line=ScreenChar(winwidth(0))
4439
:call DoRecordScreen()
45-
:let g:test ="Test 5: set nolinebreak list"
46-
:set list nolinebreak
47-
:redraw!
48-
:let line=ScreenChar(winwidth(0))
49-
:call DoRecordScreen()
50-
:let g:test ="Test 6: set linebreak with tab and 1 line as long as screen: should break!"
40+
:let g:test ="Test 4: set linebreak with tab and 1 line as long as screen: should break!"
5141
:set nolist linebreak ts=8
5242
:let line="1\t".repeat('a', winwidth(0)-2)
5343
:$put =line

src/testdir/test_listlbr.ok

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
11

2-
abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP
2+
abcdef hijklmn pqrstuvwxyz_1060ABCDEFGHIJKLMNOP
33

44
Test 1: set linebreak
55
abcdef
66
+hijklmn
7-
+pqrstuvwxyz 1060ABC
7+
+pqrstuvwxyz_1060ABC
88
+DEFGHIJKLMNOP
99

1010
Test 2: set linebreak + set list
1111
^Iabcdef hijklmn^I
12-
+pqrstuvwxyz 1060ABC
12+
+pqrstuvwxyz_1060ABC
1313
+DEFGHIJKLMNOP
1414

1515

16-
Test 3: set linebreak + set list + fancy listchars
17-
▕———abcdef
18-
+hijklmn▕———
19-
+pqrstuvwxyz␣1060ABC
20-
+DEFGHIJKLMNOPˑ¶
21-
22-
Test 4: set linebreak nolist
16+
Test 3: set linebreak nolist
2317
abcdef
2418
+hijklmn
25-
+pqrstuvwxyz 1060ABC
19+
+pqrstuvwxyz_1060ABC
2620
+DEFGHIJKLMNOP
27-
28-
Test 5: set nolinebreak list
29-
▕———abcdef hijklmn▕—
30-
+pqrstuvwxyz␣1060ABC
31-
+DEFGHIJKLMNOPˑ¶
32-
3321
1 aaaaaaaaaaaaaaaaaa
3422

35-
Test 6: set linebreak with tab and 1 line as long as screen: should break!
23+
Test 4: set linebreak with tab and 1 line as long as screen: should break!
3624
1
3725
+aaaaaaaaaaaaaaaaaa
3826
~

src/testdir/test_listlbr_utf8.in

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Test for linebreak and list option in utf-8 mode
2+
3+
STARTTEST
4+
:so small.vim
5+
:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
6+
:so mbyte.vim
7+
:if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif
8+
:10new|:vsp|:vert resize 20
9+
:put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \"
10+
:norm! zt
11+
:set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
12+
:fu! ScreenChar(width)
13+
: let c=''
14+
: for j in range(1,4)
15+
: for i in range(1,a:width)
16+
: let c.=nr2char(screenchar(j, i))
17+
: endfor
18+
: let c.="\n"
19+
: endfor
20+
: return c
21+
:endfu
22+
:fu! DoRecordScreen()
23+
: wincmd l
24+
: $put =printf(\"\n%s\", g:test)
25+
: $put =g:line
26+
: wincmd p
27+
:endfu
28+
:let g:test ="Test 1: set linebreak + set list + fancy listchars"
29+
:exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
30+
:redraw!
31+
:let line=ScreenChar(winwidth(0))
32+
:call DoRecordScreen()
33+
:let g:test ="Test 2: set nolinebreak list"
34+
:set list nolinebreak
35+
:redraw!
36+
:let line=ScreenChar(winwidth(0))
37+
:call DoRecordScreen()
38+
:%w! test.out
39+
:qa!
40+
ENDTEST
41+
dummy text

src/testdir/test_listlbr_utf8.ok

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP
3+
4+
Test 1: set linebreak + set list + fancy listchars
5+
▕———abcdef
6+
+hijklmn▕———
7+
+pqrstuvwxyz␣1060ABC
8+
+DEFGHIJKLMNOPˑ¶
9+
10+
Test 2: set nolinebreak list
11+
▕———abcdef hijklmn▕—
12+
+pqrstuvwxyz␣1060ABC
13+
+DEFGHIJKLMNOPˑ¶
14+

0 commit comments

Comments
 (0)