Mercurial > vim
annotate src/testdir/test1.in @ 16720:9c90cf08cfa8 v8.1.1362
patch 8.1.1362: code and data in tests can be hard to read
commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 20 22:12:34 2019 +0200
patch 8.1.1362: code and data in tests can be hard to read
Problem: Code and data in tests can be hard to read.
Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 May 2019 22:15:06 +0200 |
parents | 43b8795f1ddf |
children |
rev | line source |
---|---|
7 | 1 |
2 First a simple test to check if the test script works. | |
3 | |
4 If Vim was not compiled with the +eval feature, the small.vim script will be | |
5 set to copy the test.ok file to test.out, so that it looks like the test | |
6 succeeded. Otherwise an empty small.vim is written. small.vim is sourced by | |
7 tests that require the +eval feature or other features that are missing in the | |
8 small version. | |
9 | |
10 If Vim was not compiled with the +windows feature, the tiny.vim script will be | |
11 set like small.vim above. tiny.vim is sourced by tests that require the | |
12 +windows feature or other features that are missing in the tiny version. | |
13 | |
2485
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
2050
diff
changeset
|
14 If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will |
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
2050
diff
changeset
|
15 be set like small.vim above. mbyte.vim is sourced by tests that require the |
7 | 16 +multi_byte feature. |
2050 | 17 Similar logic is applied to the +mzscheme feature, using mzscheme.vim. |
7 | 18 |
19 STARTTEST | |
5363 | 20 :" If columns or lines are too small, create wrongtermsize. |
21 :" (Some tests will fail. When columns and/or lines are small) | |
22 :if &lines < 24 || &columns < 80 | sp another | w! wrongtermsize | qa! | endif | |
23 :" | |
7 | 24 :" Write a single line to test.out to check if testing works at all. |
25 :%d | |
26 athis is a test:w! test.out | |
27 :" Create small.vim and tiny.vim empty, create mbyte.vim to skip the test. | |
28 0D:w! small.vim | |
29 :w! tiny.vim | |
30 ae! test.ok | |
31 w! test.out | |
32 qa! | |
33 :w! mbyte.vim | |
2050 | 34 :w! mzscheme.vim |
3452 | 35 :" |
7 | 36 :" If +multi_byte feature supported, make mbyte.vim empty. |
37 :if has("multi_byte") | sp another | w! mbyte.vim | q | endif | |
3452 | 38 :" |
2050 | 39 :" If +mzscheme feature supported, make mzscheme.vim empty. |
40 :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif | |
3452 | 41 :" |
7 | 42 :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty. |
43 :" Otherwise write small.vim to skip the test. | |
44 :if 1 | q! | endif | |
45 :w! small.vim | |
46 :" If +windows feature not supported :sp will fail and tiny.vim will be | |
47 :" written to skip the test. | |
48 :sp another | |
49 :wq! tiny.vim | |
50 :qa! | |
51 ENDTEST | |
52 |