From ead68653508473e2b7651fdf9c4d7eceb902bbdb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 8 Mar 2016 13:42:27 +0000 Subject: [PATCH] Add an initial highlighting test --- test/highlight/regions/cmd | 1 + test/highlight/regions/display | 5 +++++ test/highlight/regions/in | 1 + test/highlight/regions/rc | 7 +++++++ test/run | 9 +++++++-- 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/highlight/regions/cmd create mode 100644 test/highlight/regions/display create mode 100644 test/highlight/regions/in create mode 100644 test/highlight/regions/rc 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 @@ +:q 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 %{"} %{(?/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 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