Mercurial > vim
annotate src/testdir/test_regexp_utf8.vim @ 16668:81be817c9d9a v8.1.1336
patch 8.1.1336: some eval functionality is not covered by tests
commit https://github.com/vim/vim/commit/17aca707f92235b6f962e637e8073162d18e6de2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 16 22:24:55 2019 +0200
patch 8.1.1336: some eval functionality is not covered by tests
Problem: Some eval functionality is not covered by tests.
Solution: Add a few more test cases. (Masato Nishihata, closes https://github.com/vim/vim/issues/4374)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 May 2019 22:30:06 +0200 |
parents | 2e2f07561f4b |
children | f4ce361bb1e5 |
rev | line source |
---|---|
8825
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for regexp in utf8 encoding |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func s:equivalence_test() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let str = "AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ" |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 let groups = split(str) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 for group1 in groups |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 for c in split(group1, '\zs') |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 " next statement confirms that equivalence class matches every |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 " character in group |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_match('^[[=' . c . '=]]*$', group1) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 for group2 in groups |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 if group2 != group1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 " next statement converts that equivalence class doesn't match |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 " character in any other group |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal(-1, match(group2, '[[=' . c . '=]]')) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 endif |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfor |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endfor |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfor |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 endfunc |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 func Test_equivalence_re1() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 set re=1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call s:equivalence_test() |
9896
7b39615c0db1
commit https://github.com/vim/vim/commit/6bff02eb530aa29aafa2cb5627399837be7a5dd5
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
25 set re=0 |
8825
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 endfunc |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 func Test_equivalence_re2() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 set re=2 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call s:equivalence_test() |
9896
7b39615c0db1
commit https://github.com/vim/vim/commit/6bff02eb530aa29aafa2cb5627399837be7a5dd5
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
31 set re=0 |
8825
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 endfunc |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
33 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
34 func s:classes_test() |
8999
f414db42d167
commit https://github.com/vim/vim/commit/490465bda6ab66f78041709cc02f48a25486a3e5
Christian Brabandt <cb@256bit.org>
parents:
8995
diff
changeset
|
35 set isprint=@,161-255 |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
36 call assert_equal('Motörhead', matchstr('Motörhead', '[[:print:]]\+')) |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
37 |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
38 let alnumchars = '' |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
39 let alphachars = '' |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
40 let backspacechar = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
41 let blankchars = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
42 let cntrlchars = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
43 let digitchars = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
44 let escapechar = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
45 let graphchars = '' |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
46 let lowerchars = '' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
47 let printchars = '' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
48 let punctchars = '' |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
49 let returnchar = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
50 let spacechars = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
51 let tabchar = '' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
52 let upperchars = '' |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
53 let xdigitchars = '' |
15709
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
54 let identchars = '' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
55 let identchars1 = '' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
56 let kwordchars = '' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
57 let kwordchars1 = '' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
58 let fnamechars = '' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
59 let fnamechars1 = '' |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
60 let i = 1 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
61 while i <= 255 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
62 let c = nr2char(i) |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
63 if c =~ '[[:alpha:]]' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
64 let alphachars .= c |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
65 endif |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
66 if c =~ '[[:alnum:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
67 let alnumchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
68 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
69 if c =~ '[[:backspace:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
70 let backspacechar .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
71 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
72 if c =~ '[[:blank:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
73 let blankchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
74 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
75 if c =~ '[[:cntrl:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
76 let cntrlchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
77 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
78 if c =~ '[[:digit:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
79 let digitchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
80 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
81 if c =~ '[[:escape:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
82 let escapechar .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
83 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
84 if c =~ '[[:graph:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
85 let graphchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
86 endif |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
87 if c =~ '[[:lower:]]' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
88 let lowerchars .= c |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
89 endif |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
90 if c =~ '[[:print:]]' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
91 let printchars .= c |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
92 endif |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
93 if c =~ '[[:punct:]]' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
94 let punctchars .= c |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
95 endif |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
96 if c =~ '[[:return:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
97 let returnchar .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
98 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
99 if c =~ '[[:space:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
100 let spacechars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
101 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
102 if c =~ '[[:tab:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
103 let tabchar .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
104 endif |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
105 if c =~ '[[:upper:]]' |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
106 let upperchars .= c |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
107 endif |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
108 if c =~ '[[:xdigit:]]' |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
109 let xdigitchars .= c |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
110 endif |
15709
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
111 if c =~ '[[:ident:]]' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
112 let identchars .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
113 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
114 if c =~ '\i' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
115 let identchars1 .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
116 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
117 if c =~ '[[:keyword:]]' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
118 let kwordchars .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
119 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
120 if c =~ '\k' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
121 let kwordchars1 .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
122 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
123 if c =~ '[[:fname:]]' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
124 let fnamechars .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
125 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
126 if c =~ '\f' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
127 let fnamechars1 .= c |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
128 endif |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
129 let i += 1 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
130 endwhile |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
131 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
132 call assert_equal('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', alphachars) |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
133 call assert_equal('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', alnumchars) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
134 call assert_equal("\b", backspacechar) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
135 call assert_equal("\t ", blankchars) |
11287
e800e8149a5b
patch 8.0.0529: line in test commented out
Christian Brabandt <cb@256bit.org>
parents:
11267
diff
changeset
|
136 call assert_equal("\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f\x7f", cntrlchars) |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
137 call assert_equal("0123456789", digitchars) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
138 call assert_equal("\<Esc>", escapechar) |
11287
e800e8149a5b
patch 8.0.0529: line in test commented out
Christian Brabandt <cb@256bit.org>
parents:
11267
diff
changeset
|
139 call assert_equal('!"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~', graphchars) |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
140 call assert_equal('abcdefghijklmnopqrstuvwxyzµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ', lowerchars) |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
141 call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ', printchars) |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
142 call assert_equal('!"#$%&''()*+,-./:;<=>?@[\]^_`{|}~', punctchars) |
11267
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
143 call assert_equal('ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ', upperchars) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
144 call assert_equal("\r", returnchar) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
145 call assert_equal("\t\n\x0b\f\r ", spacechars) |
588de97b40e7
patch 8.0.0519: character classes are not well tested
Christian Brabandt <cb@256bit.org>
parents:
9898
diff
changeset
|
146 call assert_equal("\t", tabchar) |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
147 call assert_equal('0123456789ABCDEFabcdef', xdigitchars) |
15709
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
148 |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
149 if has('win32') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
150 let identchars_ok = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz ¡¢£¤¥¦§µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
151 let kwordchars_ok = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzµÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
152 elseif has('ebcdic') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
153 let identchars_ok = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz¬®µº¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
154 let kwordchars_ok = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz¬®µº¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
155 else |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
156 let identchars_ok = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzµÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
157 let kwordchars_ok = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzµÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
158 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
159 |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
160 if has('win32') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
161 let fnamechars_ok = '!#$%+,-./0123456789:=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_abcdefghijklmnopqrstuvwxyz{}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
162 elseif has('amiga') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
163 let fnamechars_ok = '$+,-./0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
164 elseif has('vms') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
165 let fnamechars_ok = '#$%+,-./0123456789:;<>ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
166 elseif has('ebcdic') |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
167 let fnamechars_ok = '#$%+,-./=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
168 else |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
169 let fnamechars_ok = '#$%+,-./0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
170 endif |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
171 |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
172 call assert_equal(identchars_ok, identchars) |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
173 call assert_equal(kwordchars_ok, kwordchars) |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
174 call assert_equal(fnamechars_ok, fnamechars) |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
175 |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
176 call assert_equal(identchars1, identchars) |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
177 call assert_equal(kwordchars1, kwordchars) |
2e2f07561f4b
patch 8.1.0862: no verbose version of character classes
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
178 call assert_equal(fnamechars1, fnamechars) |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
179 endfunc |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
180 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
181 func Test_classes_re1() |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
182 set re=1 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
183 call s:classes_test() |
9896
7b39615c0db1
commit https://github.com/vim/vim/commit/6bff02eb530aa29aafa2cb5627399837be7a5dd5
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
184 set re=0 |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
185 endfunc |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
186 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
187 func Test_classes_re2() |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
188 set re=2 |
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
189 call s:classes_test() |
9896
7b39615c0db1
commit https://github.com/vim/vim/commit/6bff02eb530aa29aafa2cb5627399837be7a5dd5
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
190 set re=0 |
8995
3cf6704d6efc
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Christian Brabandt <cb@256bit.org>
parents:
8825
diff
changeset
|
191 endfunc |
11480
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
192 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
193 func Test_reversed_range() |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
194 for re in range(0, 2) |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
195 exe 'set re=' . re |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
196 call assert_fails('call match("abc def", "[c-a]")', 'E944:') |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
197 endfor |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
198 set re=0 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
199 endfunc |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
200 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
201 func Test_large_class() |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
202 set re=1 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
203 call assert_fails('call match("abc def", "[\u3000-\u4000]")', 'E945:') |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
204 set re=2 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
205 call assert_equal(0, 'abc def' =~# '[\u3000-\u4000]') |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
206 call assert_equal(1, "\u3042" =~# '[\u3000-\u4000]') |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
207 set re=0 |
99ce30ac4226
patch 8.0.0623: error for invalid regexp is not very informative
Christian Brabandt <cb@256bit.org>
parents:
11287
diff
changeset
|
208 endfunc |