1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-24 07:53:41 +03:00
kakoune/test
Maxime Coste 41f19f8dc9 Add support for %file{...} expansions
This should make the use case exposed in #2836 implementable.
2019-04-07 09:43:40 +10:00
..
compose Add support for %file{...} expansions 2019-04-07 09:43:40 +10:00
display test/run: Rename "display" expected ui output file as "ui-out" 2018-05-19 14:15:16 +10:00
highlight Add support for named captures to the regex impl and regex highlighter 2019-01-03 22:55:50 +11:00
hooks Change remove-hooks to take a regular expression 2018-09-12 21:26:21 +10:00
indent Fix autoindent issues with paren in literal 2019-03-31 00:07:12 -04:00
normal Add a test case for dropping full whitespace selections on trim 2018-11-27 21:05:35 +11:00
regression Add categories in rc/ 2019-03-21 01:06:16 +01:00
shell Add support for -shell-script-* completion in :prompt 2019-03-24 19:28:46 +11:00
README.asciidoc Include more details in test/README.asciidoc 2019-02-15 11:45:06 -08:00
run Refactor colorize function away from the test script 2019-03-12 23:22:03 +01:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Regression test
===============

:unified-context-diff: https://en.wikipedia.org/wiki/Diff#Unified_format

Source structure
----------------

----------------------------------------------
.
├── unit
│   └── …
└── compose
    └── …
        ├── [rc]         → configuration
        ├── cmd          → command
        ├── [in]         → start file
        ├── [ui-in]      → start UI state in JSON format
        ├── [out]        → end file
        ├── [ui-out]     → output UI state in JSON format
        ├── [selections] → selection contents
        ├── [state]      → selection states
        └── [error]      → error bypass
----------------------------------------------

Usage
-----

To test, just type +run [test]+ in the +test+ directory.
It will print each passing test.  If a test fails, a {unified-context-diff}[unified context diff]
is printed showing the tests expected output and the actual output.

Details
-------

+rc+ is optional
and should contain a sequence of commands,
_e.g._, +set-option+, +define-command+, +declare-option+.
+rc+ is sourced and evaluated before the +cmd+ key sequence is executed.

+cmd+ is required
and should contain a key sequence that will edit the input buffer.
+cmd+ is executed after the +rc+ command sequence is sourced.

+in+ is optional
and should contain the initial text loaded into the input buffer
for editing by the +cmd+ key sequence.

+ui-in+ is optional
and should contain the json-rpc commands sent by the UI at startup.

+out+ is optional
and should contain the expected text generated by the +cmd+ key sequence.

+ui-out+ is optional
and should contain the expected UI JSON output.

+selections+ is optional
and should contain the expected value of +$kak_selections+
(_i.e._, content of the selection separated by colons).

+state+ is optional
and should contain the expected value of +$kak_selections_desc+
(_i.e._, range of the selections separated by colons).

If the actual +output+ text, +selections+, +state+, or +ui-out+
does not match the expected content in the corresponding file,
the unit test will fail.

If there is no +output+, +selections+, +state+, or +ui-out+ file,
then the unit test will always succeed.

If there is an +error+ file, which could be empty,
then the unit test will always fail.