CI: Add test for highlight dates (issue #309, pr #1315)

This commit is contained in:
Tinmarino
2023-06-22 12:41:02 -04:00
parent 322d22bef8
commit e0a04e11b8
3 changed files with 60 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# Non regression tests for issue:
# -- How to turn off inline math highlights?
Given vimwiki (All math inline possible):
12345678901234567890123456789
2023-06-22
23-06-22
due:2023-06-22
+ProjectName project description
@ContextName context description
Other +ProjectName and desc
Other @ContectName and desc
Execute (Assert all lines):
# Math
AssertEqual 'normal', GetSyntaxVimwiki(1, 1)
AssertEqual 'TodoDate', GetSyntaxVimwiki(2, 1)
AssertEqual 'TodoDate', GetSyntaxVimwiki(3, 1)
AssertEqual 'TodoDueDate', GetSyntaxVimwiki(4, 1)
AssertEqual 'TodoProject', GetSyntaxVimwiki(6, 1)
AssertEqual 'normal', GetSyntaxVimwiki(6, 15)
AssertEqual 'TodoContext', GetSyntaxVimwiki(7, 1)
AssertEqual 'normal', GetSyntaxVimwiki(7, 15)
AssertEqual 'normal', GetSyntaxVimwiki(9, 1)
AssertEqual 'TodoProject', GetSyntaxVimwiki(9, 10)
AssertEqual 'normal', GetSyntaxVimwiki(9, 20)
AssertEqual 'normal', GetSyntaxVimwiki(10, 1)
AssertEqual 'TodoContext', GetSyntaxVimwiki(10, 10)
AssertEqual 'normal', GetSyntaxVimwiki(10, 20)
+16
View File
@@ -0,0 +1,16 @@
# Non regression tests for issue TODO
# -- TODO copy-paste issue description
#
# Syntax: https://github.com/junegunn/vader.vim#syntax-of-vader-file
# Run: bash run_tests.sh -v -t vader -n vim_7.3.429 -f issue_example.vader
Given vimwiki (Input file):
test
Execute (Call function to verify):
echo 'Dummy command, not displayed'
Log 'Debug message displayed in Vader output'
AssertEqual 'test', getline(1), 'Dummy assertion'
Expect (Output file):
test
+8
View File
@@ -343,6 +343,14 @@
0d
endfunction
function! GetSyntaxVimwiki(line, col)
let res = GetSyntaxStack(a:line, a:col)
if empty(res)
return 'normal'
endif
return res[0]
endfunction
function! GetSyntaxGroup(...)
" Get normalized syntax group: usefull for boldItalic Vs italicBold
" Arg1: line