Add an initial highlighting test
This commit is contained in:
parent
3cbc0d0b39
commit
ead6865350
1
test/highlight/regions/cmd
Normal file
1
test/highlight/regions/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<c-l>:q<ret>
|
5
test/highlight/regions/display
Normal file
5
test/highlight/regions/display
Normal 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] }
|
1
test/highlight/regions/in
Normal file
1
test/highlight/regions/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
"abcdefgh" hehe ${ youhou{hihi} }
|
7
test/highlight/regions/rc
Normal file
7
test/highlight/regions/rc
Normal 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
|
9
test/run
9
test/run
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user