Mercurial > vim
annotate src/testdir/test_regexp_latin.vim @ 9780:103ad8a18ebc v7.4.2165
commit https://github.com/vim/vim/commit/83b3c3d8a0fa1afed06c13163b9f72c0925f2a61
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 6 19:16:43 2016 +0200
patch 7.4.2165
Problem: Startup test fails on MS-Windows.
Solution: Don't check output if RunVim() returns zero.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 06 Aug 2016 19:30:05 +0200 |
parents | 318eaa6fa973 |
children | 064effd222a3 |
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 latin1 encoding |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 set encoding=latin1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 scriptencoding latin1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func s:equivalence_test() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 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ñ 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
|
7 let groups = split(str) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 for group1 in groups |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 for c in split(group1, '\zs') |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " 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
|
11 " character in group |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_match('^[[=' . c . '=]]*$', group1) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 for group2 in groups |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 if group2 != group1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " 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
|
16 " a character in any other group |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal(-1, match(group2, '[[=' . c . '=]]')) |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endif |
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 endfor |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 endfor |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 endfunc |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 func Test_equivalence_re1() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 set re=1 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 call s:equivalence_test() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endfunc |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 func Test_equivalence_re2() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 set re=2 |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call s:equivalence_test() |
318eaa6fa973
commit https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 endfunc |