annotate src/testdir/test_exec_while_if.vim @ 19783:546bdeef35f1 v8.2.0448

patch 8.2.0448: various functions not properly tested Commit: https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 22:23:46 2020 +0100 patch 8.2.0448: various functions not properly tested Problem: Various functions not properly tested. Solution: Add more tests, especially for failures. (Yegappan Lakshmanan, closes #5843)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 22:30:04 +0100
parents 140d51d5b5c3
children 08940efa6b4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11651
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for :execute, :while and :if
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 function Test_exec_while_if()
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 new
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let i = 0
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 while i < 12
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 let i = i + 1
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 if has("ebcdic")
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 execute "normal o" . i . "\047"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 else
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 execute "normal o" . i . "\033"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 if i % 2
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 normal Ax
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 if i == 9
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 break
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 if i == 5
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 continue
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 else
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 let j = 9
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 while j > 0
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 if has("ebcdic")
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 execute "normal" j . "a" . j . "\x27"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 else
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 execute "normal" j . "a" . j . "\x1b"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 let j = j - 1
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 endwhile
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 if i == 9
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 if has("ebcdic")
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 execute "normal Az\047"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 else
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 execute "normal Az\033"
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 endif
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 endwhile
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 unlet i j
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 call assert_equal(["",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 \ "1x999999999888888887777777666666555554444333221",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 \ "2",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ "3x999999999888888887777777666666555554444333221",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 \ "4",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ "5x",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \ "6",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \ "7x999999999888888887777777666666555554444333221",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \ "8",
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 \ "9x"], getline(1, 10))
140d51d5b5c3 patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 endfunction