Mercurial > vim
view src/testdir/test_regexp_latin.vim @ 10062:103d874ebb96 v7.4.2302
commit https://github.com/vim/vim/commit/f1b512a0b62d0fa47ee9b2612556f375e1f22fc2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 1 20:50:54 2016 +0200
patch 7.4.2302
Problem: Default interface versions for MS-Windows are outdated.
Solution: Use Active Perl 5.24, Python 3.5.2. Could only make it work with
Ruby 1.9.2.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 01 Sep 2016 21:00:08 +0200 |
parents | 3ee84d270ea7 |
children | 3c37899baa8d |
line wrap: on
line source
" Tests for regexp in latin1 encoding set encoding=latin1 scriptencoding latin1 func s:equivalence_test() 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" let groups = split(str) for group1 in groups for c in split(group1, '\zs') " next statement confirms that equivalence class matches every " character in group call assert_match('^[[=' . c . '=]]*$', group1) for group2 in groups if group2 != group1 " next statement converts that equivalence class doesn't match " a character in any other group call assert_equal(-1, match(group2, '[[=' . c . '=]]')) endif endfor endfor endfor endfunc func Test_equivalence_re1() set re=1 call s:equivalence_test() endfunc func Test_equivalence_re2() set re=2 call s:equivalence_test() endfunc func Test_recursive_substitute() new s/^/\=execute("s#^##gn") " check we are now not in the sandbox call setwinvar(1, 'myvar', 1) bwipe! endfunc