vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

README.md

(1614B)


      1 Tests for vis - a vim-like editor frontend
      2 ------------------------------------------
      3 
      4 The basic idea is to feed the same keyboard input to both vim
      5 and vis and compare their respective results.
      6 
      7 A test constitutes of 2 files:
      8 
      9  * `test.in` the file/buffer content with which the editor is started
     10  * `test.keys` a file containing the keyboard input as would normally
     11    be typed by a user
     12 
     13 The `*.keys` file are piped through the C preprocessor `cpp(1)`, trailing
     14 white spaces are stripped before the [keys utility](../util) translates
     15 the symbolic keys to terminal input sequences suitable for consumption
     16 by the actual editor processes. In rare cases it might be necessary to
     17 inspect intermediate states of this pipeline for debugging purposes.
     18 Some general hints on writing test:
     19 
     20  * Make sure all input files are properly new line terminated, otherwise
     21    you will get test failures because vim will add a trailing new line
     22    whereas vis leafs the input file as is.
     23 
     24  * Place logically different commands on different input lines. The
     25    new lines are insignificant. To enter a literal new line use `<Enter>`.
     26 
     27  * Use C style comments `/* ... */` or `// ...` to explain complex text
     28    manipulations. However, be aware that due to the use of the C
     29    preprocessor comments do not mix well with unterminated string
     30    constants as used to specify registers.
     31 
     32 The top level shell script `test.sh` looks for the `*.keys` files in
     33 subdirectories, executes both editors and compares the resulting output.
     34 `test.sh path/to/test` (without the file extension) runs an individual
     35 test.
     36 
     37 Type `make` to run all tests.