1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-30 13:43:41 +03:00
kakoune/test
2020-09-16 11:00:15 +03:00
..
compose Expand env vars as list of strings 2020-03-02 20:53:28 +11:00
display test: Allow expect-style UI tests, testing any var 2019-10-13 14:57:24 -04:00
highlight Fix escaping of single quotes in rust value highlighting test 2020-07-31 07:55:27 +10:00
hooks Change remove-hooks to take a regular expression 2018-09-12 21:26:21 +10:00
indent Provide better support for Go language. 2020-09-07 21:48:06 +02:00
normal Support count argument for [s and ]s 2020-08-02 11:30:14 +02:00
regression test: Implement a regression test for #3733 2020-09-16 11:00:15 +03:00
shell Expand env vars as list of strings 2020-03-02 20:53:28 +11:00
README.asciidoc Fix typo in readme 2020-05-28 21:41:21 +02:00
run Drain ui-out to avoid deadlock with small pipe buffers 2020-06-10 09:26:32 +10: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 to 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.