Add an initial highlighting test

This commit is contained in:
Maxime Coste 2016-03-08 13:42:27 +00:00
parent 3cbc0d0b39
commit ead6865350
5 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1 @@
<c-l>:q<ret>

View File

@ -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] }

View File

@ -0,0 +1 @@
"abcdefgh" hehe ${ youhou{hihi} }

View File

@ -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

View File

@ -12,7 +12,7 @@ main() {
trap "rm -R $work" EXIT trap "rm -R $work" EXIT
for dir in $(find $dirs -type d | sort); do for dir in $(find $dirs -type d | sort); do
cd $test/$dir; 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; cd $work/$dir;
indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')" indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')"
name=$(basename $PWD) name=$(basename $PWD)
@ -26,6 +26,8 @@ main() {
touch in; cp in out touch in; cp in out
kak_commands=" kak_commands="
set global autoreload yes set global autoreload yes
set global autoinfo ''
set global autoshowcompl false
try %{ try %{
source rc source rc
} }
@ -40,6 +42,7 @@ main() {
quit! quit!
} }
exec '$(cat cmd | sed -e s/\'/\\\\\'/g)' exec '$(cat cmd | sed -e s/\'/\\\\\'/g)'
exec <c-l>
eval -buffer *debug* write debug eval -buffer *debug* write debug
nop %sh{ nop %sh{
IFS== IFS==
@ -49,7 +52,9 @@ main() {
write out write out
quit! 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=$? retval=$?
if [ $should_fail = 0 ]; then if [ $should_fail = 0 ]; then
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then