diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-03-08 13:42:27 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-03-08 13:42:27 +0000 |
| commit | ead68653508473e2b7651fdf9c4d7eceb902bbdb (patch) | |
| tree | 33866756f32515d597b13228a44e79e131f1ad39 /test | |
| parent | 3cbc0d0b393051e9df2647956fbc16a26f27f795 (diff) | |
Add an initial highlighting test
Diffstat (limited to 'test')
| -rw-r--r-- | test/highlight/regions/cmd | 1 | ||||
| -rw-r--r-- | test/highlight/regions/display | 5 | ||||
| -rw-r--r-- | test/highlight/regions/in | 1 | ||||
| -rw-r--r-- | test/highlight/regions/rc | 7 | ||||
| -rwxr-xr-x | test/run | 9 |
5 files changed, 21 insertions, 2 deletions
diff --git a/test/highlight/regions/cmd b/test/highlight/regions/cmd new file mode 100644 index 00000000..db6cccd0 --- /dev/null +++ b/test/highlight/regions/cmd @@ -0,0 +1 @@ +<c-l>:q<ret> diff --git a/test/highlight/regions/display b/test/highlight/regions/display new file mode 100644 index 00000000..8b839286 --- /dev/null +++ b/test/highlight/regions/display @@ -0,0 +1,5 @@ +{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "\"" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "abcdefgh\"" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": " hehe " }, { "face": { "fg": "red", "bg": "default", "attributes": [] }, "contents": "${ youhou{hihi} }" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "\u000a" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "" }]], { "fg": "default", "bg": "default", "attributes": [] }] } +{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] } +{ "jsonrpc": "2.0", "method": "info_hide", "params": [] } +{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - unnamed0@[kak-test-highlight-regions]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] } +{ "jsonrpc": "2.0", "method": "refresh", "params": [true] } diff --git a/test/highlight/regions/in b/test/highlight/regions/in new file mode 100644 index 00000000..8b76db01 --- /dev/null +++ b/test/highlight/regions/in @@ -0,0 +1 @@ +"abcdefgh" hehe ${ youhou{hihi} } diff --git a/test/highlight/regions/rc b/test/highlight/regions/rc new file mode 100644 index 00000000..4679889e --- /dev/null +++ b/test/highlight/regions/rc @@ -0,0 +1,7 @@ +addhl regions -default code regions_test \ + string %{"} %{(?<!\\)(\\\\)*"} '' \ + shell '\$\{' '\}' '\{' + +addhl -group regions_test/code fill yellow +addhl -group regions_test/string fill green +addhl -group regions_test/shell fill red @@ -12,7 +12,7 @@ main() { trap "rm -R $work" EXIT for dir in $(find $dirs -type d | sort); do cd $test/$dir; - test_files=$(ls out selections state 2>/dev/null) + test_files=$(ls out selections state display 2>/dev/null) cd $work/$dir; indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')" name=$(basename $PWD) @@ -26,6 +26,8 @@ main() { touch in; cp in out kak_commands=" set global autoreload yes + set global autoinfo '' + set global autoshowcompl false try %{ source rc } @@ -40,6 +42,7 @@ main() { quit! } exec '$(cat cmd | sed -e s/\'/\\\\\'/g)' + exec <c-l> eval -buffer *debug* write debug nop %sh{ IFS== @@ -49,7 +52,9 @@ main() { write out quit! " - ${test}/../src/kak out -n -ui dummy -e "$kak_commands" + session="kak-test-$(echo -n "$dir" | sed -e 's+^\./++; s+/+-+g')" + rm -f /tmp/kakoune/$USER/$session + ${test}/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > display retval=$? if [ $should_fail = 0 ]; then if [ $retval -ne 0 ]; then |
