Mercurial > vim
annotate src/testdir/test82.in @ 5737:e25a04c1c515 v7.4.213
updated for version 7.4.213
Problem: It's not possible to open a new buffer without creating a swap
file.
Solution: Add the ":noswapfile" modifier. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 23 Mar 2014 16:04:02 +0100 |
parents | 46cf49cc9289 |
children | bc269cf15ccd |
rev | line source |
---|---|
2965 | 1 Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c) |
5288
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
2 Also test "g~ap". |
2965 | 3 |
4 STARTTEST | |
5 :so small.vim | |
6 :if !has("multi_byte") | |
7 : e! test.ok | |
8 : w! test.out | |
9 : qa! | |
10 :endif | |
11 :set enc=utf8 | |
12 ggdG | |
13 : | |
14 :function! Ch(a, op, b, expected) | |
15 : if eval(printf('"%s" %s "%s"', a:a, a:op, a:b)) != a:expected | |
16 : call append(line('$'), printf('"%s" %s "%s" should return %d', a:a, a:op, a:b, a:expected)) | |
17 : else | |
18 : let b:passed += 1 | |
19 : endif | |
20 :endfunction | |
21 : | |
22 :function! Chk(a, b, result) | |
23 : if a:result == 0 | |
24 : call Ch(a:a, '==?', a:b, 1) | |
25 : call Ch(a:a, '!=?', a:b, 0) | |
26 : call Ch(a:a, '<=?', a:b, 1) | |
27 : call Ch(a:a, '>=?', a:b, 1) | |
28 : call Ch(a:a, '<?', a:b, 0) | |
29 : call Ch(a:a, '>?', a:b, 0) | |
30 : elseif a:result > 0 | |
31 : call Ch(a:a, '==?', a:b, 0) | |
32 : call Ch(a:a, '!=?', a:b, 1) | |
33 : call Ch(a:a, '<=?', a:b, 0) | |
34 : call Ch(a:a, '>=?', a:b, 1) | |
35 : call Ch(a:a, '<?', a:b, 0) | |
36 : call Ch(a:a, '>?', a:b, 1) | |
37 : else | |
38 : call Ch(a:a, '==?', a:b, 0) | |
39 : call Ch(a:a, '!=?', a:b, 1) | |
40 : call Ch(a:a, '<=?', a:b, 1) | |
41 : call Ch(a:a, '>=?', a:b, 0) | |
42 : call Ch(a:a, '<?', a:b, 1) | |
43 : call Ch(a:a, '>?', a:b, 0) | |
44 : endif | |
45 :endfunction | |
46 : | |
47 :function! Check(a, b, result) | |
48 : call Chk(a:a, a:b, a:result) | |
49 : call Chk(a:b, a:a, -a:result) | |
50 :endfunction | |
51 : | |
52 :function! LT(a, b) | |
53 : call Check(a:a, a:b, -1) | |
54 :endfunction | |
55 : | |
56 :function! GT(a, b) | |
57 : call Check(a:a, a:b, 1) | |
58 :endfunction | |
59 : | |
60 :function! EQ(a, b) | |
61 : call Check(a:a, a:b, 0) | |
62 :endfunction | |
63 : | |
64 :let b:passed=0 | |
65 :call EQ('', '') | |
66 :call LT('', 'a') | |
67 :call EQ('abc', 'abc') | |
68 :call EQ('Abc', 'abC') | |
69 :call LT('ab', 'abc') | |
70 :call LT('AB', 'abc') | |
71 :call LT('ab', 'aBc') | |
72 :call EQ('\xd0\xb9\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd', '\xd0\xb9\xd0\xa6\xd0\xa3\xd0\xba\xd0\x95\xd0\xbd') | |
73 :call LT('\xd0\xb9\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd', '\xd0\xaf\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd') | |
74 :call EQ('\xe2\x84\xaa', 'k') | |
75 :call LT('\xe2\x84\xaa', 'kkkkkk') | |
76 :call EQ('\xe2\x84\xaa\xe2\x84\xaa\xe2\x84\xaa', 'kkk') | |
77 :call LT('kk', '\xe2\x84\xaa\xe2\x84\xaa\xe2\x84\xaa') | |
78 :call EQ('\xe2\x84\xaa\xe2\x84\xa6k\xe2\x84\xaak\xcf\x89', 'k\xcf\x89\xe2\x84\xaakk\xe2\x84\xa6') | |
79 :call EQ('Abc\x80', 'AbC\x80') | |
80 :call LT('Abc\x80', 'AbC\x81') | |
81 :call LT('Abc', 'AbC\x80') | |
82 :call LT('abc\x80DEF', 'abc\x80def') " case folding stops at the first bad character | |
83 :call LT('\xc3XYZ', '\xc3xyz') | |
84 :call EQ('\xef\xbc\xba', '\xef\xbd\x9a') " FF3A (upper), FF5A (lower) | |
85 :call GT('\xef\xbc\xba', '\xef\xbc\xff') " first string is ok and equals \xef\xbd\x9a after folding, second string is illegal and was left unchanged, then the strings were bytewise compared | |
86 :call LT('\xc3', '\xc3\x83') | |
87 :call EQ('\xc3\xa3xYz', '\xc3\x83XyZ') | |
88 :for n in range(0x60, 0xFF) | call LT(printf('xYz\x%.2X', n-1), printf('XyZ\x%.2X', n)) | endfor | |
89 :for n in range(0x80, 0xBF) | call EQ(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor | |
90 :for n in range(0xC0, 0xFF) | call LT(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor | |
91 :call append(0, printf('%d checks passed', b:passed)) | |
5288
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
92 :" |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
93 :" test that g~ap changes one paragraph only. |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
94 :new |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
95 iabcd |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
96 |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
97 defggg0g~ap:let lns = getline(1,3) |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
98 :q! |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
99 :call append(line('$'), lns) |
46cf49cc9289
updated for version 7.4b.020
Bram Moolenaar <bram@vim.org>
parents:
2965
diff
changeset
|
100 :" |
2965 | 101 :wq! test.out |
102 ENDTEST | |
103 |