Mercurial > vim
annotate src/testdir/README.txt @ 10694:fa6c4825a1c4 v8.0.0237
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
commit https://github.com/vim/vim/commit/ba47b51ff88d91c9bb5aa522183e23a656865697
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 21:18:19 2017 +0100
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Problem: When setting wildoptions=tagfile the completion context is not set
correctly. (desjardins)
Solution: Check for EXPAND_TAGS_LISTFILES. (Christian Brabandt, closes #1399)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Jan 2017 21:30:04 +0100 |
parents | 055b1633aed7 |
children | 013c44d9dc09 |
rev | line source |
---|---|
6168 | 1 This directory contains tests for various Vim features. |
2 | |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
3 If it makes sense, add a new test method to an already existing file. You may |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
4 want to separate it from other tests with comment lines. |
6168 | 5 |
9909
3ee84d270ea7
commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents:
9228
diff
changeset
|
6 The numbered tests are older, we have switched to named tests. Don't add any |
3ee84d270ea7
commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents:
9228
diff
changeset
|
7 more numbered tests. |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
8 |
9228
ea504064c996
commit https://github.com/vim/vim/commit/fd89d7ea81b18d32363456b16258174dc9e095dc
Christian Brabandt <cb@256bit.org>
parents:
8011
diff
changeset
|
9 And then you can choose between a new style test, which is a Vim script, or an |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
10 old style test, which uses Normal mode commands. Use a new style test if you |
9909
3ee84d270ea7
commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents:
9228
diff
changeset
|
11 can. Use an old style test when it needs to run without the +eval feature. |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
12 |
6168 | 13 |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
14 TO ADD A NEW STYLE TEST: |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
15 |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
16 1) Create a test_<subject>.vim file. |
10549
055b1633aed7
patch 8.0.0164: outdated and misplaced comments
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
17 2) Add test_<subject>.res to NEW_TESTS in Make_all.mak in alphabetical order. |
055b1633aed7
patch 8.0.0164: outdated and misplaced comments
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
18 3) Also add an entry in src/Makefile. |
055b1633aed7
patch 8.0.0164: outdated and misplaced comments
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
19 4) Use make test_<subject>.res to run a single test in src/testdir/. |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
20 Use make test_<subject> to run a single test in src/. |
6168 | 21 |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
22 What you can use (see test_assert.vim for an example): |
10100
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
23 - Call assert_equal(), assert_true(), assert_false(), etc. |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
24 - Use try/catch to check for exceptions. |
9228
ea504064c996
commit https://github.com/vim/vim/commit/fd89d7ea81b18d32363456b16258174dc9e095dc
Christian Brabandt <cb@256bit.org>
parents:
8011
diff
changeset
|
25 - Use alloc_fail() to have memory allocation fail. This makes it possible |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
26 to check memory allocation failures are handled gracefully. You need to |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
27 change the source code to add an ID to the allocation. Update LAST_ID_USED |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
28 above alloc_id() to the highest ID used. |
8011
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7517
diff
changeset
|
29 - Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7517
diff
changeset
|
30 a while. E.g. to trigger the CursorMovedI autocommand event. |
26f555e9aab1
commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Christian Brabandt <cb@256bit.org>
parents:
7517
diff
changeset
|
31 See test_cursor_func.vim for an example |
10100
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
32 - If the bug that is being tested isn't fixed yet, you can throw an exception |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
33 so that it's clear this still needs work. E.g.: |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
34 throw "Skipped: Bug with <c-e> and popupmenu not fixed yet" |
9228
ea504064c996
commit https://github.com/vim/vim/commit/fd89d7ea81b18d32363456b16258174dc9e095dc
Christian Brabandt <cb@256bit.org>
parents:
8011
diff
changeset
|
35 - See the start of runtest.vim for more help. |
7517
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
36 |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
37 |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
38 TO ADD AN OLD STYLE TEST: |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
39 |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
40 1) Create test_<subject>.in and test_<subject>.ok files. |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
41 2) Add test_<subject>.out to SCRIPTS_ALL in Make_all.mak in alphabetical order. |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
42 3) Use make test_<subject>.out to run a single test in src/testdir/. |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
43 Use make test_<subject> to run a single test in src/. |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
44 4) Also add an entry in src/Makefile. |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
45 |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
46 Keep in mind that the files are used as if everything was typed: |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
47 - To add comments use: :" (that's an Ex command comment) |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
48 - A line break is like pressing Enter. If that happens on the last line |
9d67399f49c6
commit https://github.com/vim/vim/commit/6602af7fe069246dbcf419c3e904a78b60e7d4dc
Christian Brabandt <cb@256bit.org>
parents:
7478
diff
changeset
|
49 you'll hear a beep! |