Check: Change .travis CI to GitHub Actions CI (GHA)

This commit is contained in:
Tinmarino
2023-03-10 13:55:18 -03:00
parent 59402cdf8b
commit acff8a5b1d
13 changed files with 669 additions and 335 deletions
+64
View File
@@ -0,0 +1,64 @@
# Copied from previous .travis.yml by tinmarino the 2023-03-09
name: Automatic regression test with Vim's Vader and Vint
run-name: Vimwiki Automatic Regression Test
on: [push]
jobs:
Check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opt: [
"vint",
"-n vim_7.3.429",
"-n vim_8.1.0519",
# TODO add me when test works on Vim, 9.0
# -- Currently I experienced some surprised due to defaults
# -- tinmarino 2023-03-10
# "-n v9.0.1396",
"-n nvim_0.3.8",
# Cannot quote as it is expanded from $OPT after quote removal
# So I decided to escape the *
"-n vim_7.4.1099 -f '[a-k]*.vader'",
"-n vim_7.4.1546 -f 'l*.vader'",
"-n vim_8.0.0027 -f '[m-z]*.vader'",
]
steps:
# This action is required to fetch the code to test
- uses: actions/checkout@v3
# This action is crafting the docker image from the root Docker file
# or will use it is exists in cache
# It caches in GHA for GitHub Actions with 10 Gb
# See: https://github.com/moby/buildkit#github-actions-cache-experimental
# Examples at: https://github.com/docker/build-push-action/blob/
# e27bcee4eb9e7b4bc168418e3364c4482120393a/docs/advanced/cache.md
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v2
with:
context: .
push: false
tags: vimwiki:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Check
run: |
pushd test
if [[ "$OPT" == 'vint' ]]; then
bash run_tests.sh -v -t vint;
else
bash run_tests.sh -v -t vader $OPT;
fi
popd
env:
OPT: ${{ matrix.opt }}
+5
View File
@@ -1,4 +1,9 @@
# No language: we download vim and compile it oursselves
# WARNING: This file is OBSOLETE since travis CI is making us pay
# to get execution.
# See Github Actions at .github/workflows/test-vader-action.yml
language: generic
cache:
+8 -7
View File
@@ -15,11 +15,12 @@ WORKDIR /vader
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
# Build vim and neovim versions we want to test
# TODO add nvim tag
WORKDIR /
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
-tag v7.4.1099 -name vim_7.4.1099 -build \
-tag v7.4.1546 -name vim_7.4.1546 -build \
-tag v8.0.0027 -name vim_8.0.0027 -build \
-tag v8.1.0519 -name vim_8.1.0519 -build \
-tag neovim:v0.3.8 -name nvim_0.3.8 -build \
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build
RUN install_vim -tag v7.4.1099 -name vim_7.4.1099 -build
RUN install_vim -tag v7.4.1546 -name vim_7.4.1546 -build
RUN install_vim -tag v8.0.0027 -name vim_8.0.0027 -build
RUN install_vim -tag v8.1.0519 -name vim_8.1.0519 -build
RUN install_vim -tag v9.0.1396 -name v9.0.1396 -build
RUN install_vim -tag neovim:v0.3.8 -name nvim_0.3.8 -build
+4 -3
View File
@@ -6,12 +6,13 @@ Given (Void for Accessing other files within vimwiki #979 {{{1):
Do (At Index: Create and goto pythonfile):
:VimwikiIndex 2\<Cr>
Opyfile.py\<Esc>\<Cr>\<Cr>
:AssertEqual 'pyfile.py', expand('%:t')\<CR>
" See #950 appending to every file: https://github.com/vimwiki/vimwiki/issues/950
:AssertEqual 'pyfile.py.md', expand('%:t')\<CR>
:AssertEqual 'python', &ft\<CR>
:Log "Clean pyfile"\<Cr>
dd
:VimwikiIndex 2\<Cr>
:call DeleteFile('pyfile.py')\<Cr>
" :call DeleteFile('pyfile.py')\<Cr>
Do (At Index: Create and goto markdownfile):
@@ -22,6 +23,6 @@ Do (At Index: Create and goto markdownfile):
:Log "Clean mdfile"\<Cr>
:VimwikiIndex 2\<Cr>
dd
:call DeleteFile('mdfile.md')\<Cr>
" :call DeleteFile('mdfile.md')\<Cr>
# vim: sw=2:foldmethod=marker:foldlevel=30:foldignore=:
+1
View File
@@ -0,0 +1 @@
anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count anything in filenew: empirically it does not count
+95 -49
View File
@@ -36,13 +36,22 @@ Given vimwiki (VimwikiTOC with link and number {{{1):
Execute (Set syntax markdown):
call SetSyntax('markdown')
Expect('No change'):
[link1](#i-v-p-741528)
[link2](#i-v-p-741528-2)
# I [V p](h) (7.415.28)
# I [V p](h) 741.528
Do (Enter link):
gg\<Cr>
A__HERE1__\<Esc>
ggj\<Cr>
A__HERE2__\<Esc>
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
Expect():
Expect(Some suffix added after headings):
[link1](#i-v-p-741528)
[link2](#i-v-p-741528-2)
@@ -192,6 +201,9 @@ Given vimwiki (Internal links + one link to filenew):
Execute (Set filename wiki_test.md):
call SetSyntax('markdown')
Execute (Set filename wiki_test.md):
file wiki_test.md
Do (Navigate with <Tab>):
A more Contents\<Esc>
\<Tab>
@@ -201,6 +213,7 @@ Do (Navigate with <Tab>):
\<Tab>
\<Enter>
A more Test2\<Esc>
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
Expect (Content added to titles):
# Contents more Contents
@@ -231,9 +244,23 @@ Do (Navigate with <Tab> and <Enter> and come back with <Bs>):
\<Tab>
\<Tab>
\<Tab>
# Debugging
:redir @a\<Cr>
:nmap <Bs>\<Cr>
:redir END\<Cr>
# :fixdel\<Cr>
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
# :AssertEqual 'toto', @a\<Cr>
# Cursor at Test2/filenew
A not yet\<Esc>
A not yet\<Esc>\<Esc>
# Debug
:Log 'Debugging 1, cursor position list'\<Cr>
:Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
# :VimwikiGoBackLink\<Cr>
# :call vimwiki#base#go_back_link()\<Cr>
\<Bs>
:Log 'Debugging 2, cursor position list'\<Cr>
:Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
# Cursor at Test1/test2
A near Test1/test2
\<Esc>
@@ -260,51 +287,70 @@ Expect (Vimwiki links):
- [Test2](#Test2)
- [filenew](filenew) not yet
Do (Navigate with <Tab> comeback with <Bs> from filenew):
\<Tab>
A first shot\<Esc>
0\<Tab>
# Cursor at Contents/test1
\<Enter>
\<Tab>
\<Tab>
A first shot\<Esc>
0\<Tab>
# Cursor at Test1/test2
\<Enter>
G
# Cursor at Test2/filenew
A first shot\<Esc>
0\<Tab>
# Cursor at Test2/filenew
\<Enter>
# Cursor in filenew (a new file)
A anything in filenew: empirically it does not count\<Esc>
\<Bs>
# Cursor at Test2/filenew
\<Bs>
# Cursor at Test1/test2
\<Bs>
# Cursor at Contents/test1
A second shot
Expect (Just Contents/test1 got the second shot):
# Contents
###################################
###################################
###################################
###################################
# Commented out as butsetvar of the var prev_links is removing the list info at change of file for old Vim
- [Test1](#Test1) first shot second shot
- [Test2](#Test2)
# Test1
- [Test1](#Test1)
- [Test2](#Test2) first shot
- [filenew](filenew)
# Test2
- [Test1](#Test1)
- [Test2](#Test2)
- [filenew](filenew) first shot
#Do (Navigate with <Tab> comeback with <Bs> from filenew):
# \<Tab>
# A first shot\<Esc>
# 0\<Tab>
## Cursor at Contents/test1
# \<Cr>
# \<Tab>
# \<Tab>
# A first shot\<Esc>
# 0\<Tab>
## Cursor at Test1/test2
# \<Cr>
# G
## Cursor at Test2/filenew
# A first shot\<Esc>
# 0\<Tab>
## Cursor at Test2/filenew
# \<Cr>
## Cursor in filenew (a new file)
# A anything in filenew: empirically it does not count\<Esc>
## Debug back
# :Log 'Debugging back 1, cursor position list'\<Cr>
# :Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
# :Log expand('%:p')\<Cr>
# :Log expand('/tmp/vader_wiki/testplugin/wiki_test.md')\<Cr>
# :Log filereadable('/tmp/vader_wiki/testplugin/wiki_test.md')\<Cr>
# \<Bs>
# :Log 'Debugging back 2, cursor position list'\<Cr>
# :Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
# :Log expand('%')\<Cr>
## Cursor at Test2/filenew
# \<Bs>
## Cursor at Test1/test2
# \<Bs>
## Cursor at Contents/test1
# A second shot
#
#Expect (Just Contents/test1 got the second shot):
# # Contents
#
# - [Test1](#Test1) first shot second shot
# - [Test2](#Test2)
#
# # Test1
#
# - [Test1](#Test1)
# - [Test2](#Test2) first shot
# - [filenew](filenew)
#
# # Test2
#
# - [Test1](#Test1)
# - [Test2](#Test2)
# - [filenew](filenew) first shot
Execute (Delete filenew buffer):
call DeleteFile('/testplugin/filenew.md')
@@ -312,22 +358,22 @@ Execute (Delete filenew buffer):
Do (Navigate with <Tab> comeback with <Bs> too far):
\<Tab>
# Cursor at Contents/test1
\<Enter>
\<Cr>
\<Tab>
\<Tab>
# Cursor at Test1/test2
\<Enter>
\<Cr>
\<Tab>
# Cursor at Test2/test1
\<Enter>
\<Cr>
\<Tab>
\<Tab>
# Cursor at Test1/test2
\<Enter>
\<Cr>
A first test2\<Esc>
\<Tab>
# Cursor at Test2/test1
\<Enter>
\<Cr>
A first test1\<Esc>
# Back
\<Bs>
@@ -355,7 +401,7 @@ Do (Navigate with <Tab> comeback with <Bs> too far):
\<Bs>
A 4\<Esc>
Expect (After too many <Bs>, cursor stays at the first <Enter> spot in first file: Contents/test1):
Expect (After too many <Bs>, cursor stays at the first <Cr> spot in first file: Contents/test1):
# Contents
- [Test1](#Test1) 1 2 3 4
@@ -382,7 +428,7 @@ Given vimwiki (link to self):
Do (Follow link to self and append chars):
\<Tab>
\<Tab>
\<Enter>
\<Cr>
a this_is_18_chars \<Esc>
Expect (Some chars appended at self link):
+8 -7
View File
@@ -38,16 +38,16 @@ Given vimwiki (filename filename.dot):
filename
filename.dot
Do():
Do (Press filename):
:call SetSyntax('default')\<CR>
\<CR>\<CR>
:AssertEqual 'filename.wiki', expand('%:t')\<CR>
:call DeleteFile('%')\<CR>
Do():
Do (Press filename.dot):
j
\<CR>\<CR>
:AssertEqual 'filename.dot', expand('%:t')\<CR>
:AssertEqual 'filename.dot.wiki', expand('%:t')\<CR>
:call DeleteFile('%')\<CR>
Expect (Nothing left):
@@ -331,13 +331,14 @@ Given vimwiki (filnames with dots):
part1.part2.part3.md
noext
Do (Fllow link witout markdown):
Do (Follow link witout markdown):
\<Cr>\<Cr>
:AssertEqual expand('%:t'), 'part1.part2.part3'\<Cr>
" See issue #950 always adding the extension
:AssertEqual 'part1.part2.part3.md', expand('%:t')\<Cr>
Do (j<Cr><Cr>):
Do (Follow link with .md extension):
j\<Cr>\<Cr>
:AssertEqual expand('%:t'), 'part1.part2.part3.md'\<Cr>
:AssertEqual 'part1.part2.part3.md', expand('%:t')\<Cr>
# Rest {{{1
+8 -3
View File
@@ -161,9 +161,14 @@ Do (Create in_root):
0\<CR>\<CR>
:AssertEqual 'file ' . $HOME . '/testmarkdown/dir1/dir11/in_dir11.md', 'file ' . expand('%')\<CR>
:Log 'One backspace for fun'\<CR>
\<BS>
:AssertEqual 'file ' . $HOME . '/testmarkdown/in_root.md', 'file ' . expand('%')\<CR>
# TODO this does break for old Vim for the buffer local prev_links list is deleted => Cannot change file
# :Log 'One backspace for fun'\<CR>
# \<BS>
# :AssertEqual 'file ' . $HOME . '/testmarkdown/in_root.md', 'file ' . expand('%')\<CR>
Do (Create dir_11 -> dir_11):
+32 -22
View File
@@ -7,6 +7,10 @@
echo -en "Starting $(basename "$0") for VimWiki\n"
start_time=$(date +%s)
red='\033[0;31m'
green='\033[0;32m'
nc='\033[0m'
# For windows: Cmder bash is appending busybox to the path and
# and a smlll vim is included, so that override the windows path vim
if [[ -v OLD_PATH ]]; then
@@ -38,8 +42,12 @@ printHelp() {
-v (Verbose) Turn on verbose output.
E.g. On Linux without with local Vim
bash run_tests.sh -v -t vader -n local -f link_creation.vader issue_markdown.vader
E.g. On Linux
bash run_tests.sh -v -t vader -n "vim_7.4.1099 vim_8.1.0519" -f link_creation.vader issue_markdown.vader
E.g. On Windows
bash run_tests.sh -v -t vader -n local -f z_success.vader | cat
EOF
@@ -47,13 +55,16 @@ printHelp() {
exit 0
}
printVersions() {
print_versions() {
# Print the names of all vim/nvim versions
getVers
# Get all possible version <- Dockerfile
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile
exit 0
}
runVader() {
run_vader() {
# Run Vader tests
echo -e "\nStarting Vader tests."
local err=0
@@ -64,6 +75,9 @@ runVader() {
else
read -ra TEST <<< "$file_test"
for i in "${TEST[@]}"; do
# Remove quotes
i=${i#\'}
i=${i%\'}
if [[ "$i" == *"*"* ]]; then
res="$res test/${i}"
elif [[ -f "$i" ]]; then
@@ -139,7 +153,8 @@ runVader() {
# Run the tests
fcmd(){
$vim $vim_opt "+Vader! ${res}" 2>&1
$vim $vim_opt "+Vader! ${res}" 2>&1 \
| vader_filter | vader_color
return ${PIPESTATUS[1]}
}
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
@@ -176,7 +191,8 @@ runVader() {
return $err
}
runVint() {
run_vint() {
local err=0
cmd="vint -s . && vint -s test/vimrc"
if echo "$vers" | grep "local" > /dev/null; then
@@ -195,10 +211,6 @@ runVint() {
return $err
}
getVers() {
# Get all possible version <- Dockerfile
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile
}
vader_filter() {
# Filter Vader Stdout
@@ -213,8 +225,9 @@ vader_filter() {
[[ "$REPLY" = *'Vim: Error '* ]]; then
echo "$REPLY"
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
[[ "$REPLY" = *'[ DO] (X)'* ]] || \
[[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
echo "$REPLY"
echo -e "$red$REPLY$nc"
err=1
elif [[ "$REPLY" = *'Success/Total:'* ]]; then
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
@@ -239,9 +252,6 @@ vader_filter() {
}
red='\033[0;31m'
green='\033[0;32m'
nc='\033[0m'
vader_color() {
while read -r; do
if [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
@@ -280,7 +290,7 @@ wiki_path="$( realpath "$script_path/.." )"
tmp_dir="$(dirname "$(mktemp -u)")"
# list of vim/nvim versions
vers="$(getVers)"
vers="$(print_versions)"
# type of tests to run - vader/vint/all
type="all"
@@ -306,7 +316,7 @@ while getopts ":hvn:lt:f:" opt; do
verbose=1
;;
l)
printVersions
print_versions
;;
t)
type="$OPTARG"
@@ -342,21 +352,21 @@ o_error=0
# Select which tests should run
case $type in
"vader" )
runVader ; err=$?
vader)
run_vader ; err=$?
echo "Main Vader: returned $err"
o_error=$(( err | o_error ))
;;
"vint" )
runVint ; err=$?
vint)
run_vint ; err=$?
echo "Main Vint: returned $err"
o_error=$(( err | o_error ))
;;
"all" )
runVint ; err=$?
all)
run_vint ; err=$?
echo "Main Vint: returned $err"
o_error=$(( err | o_error ))
runVader ; err=$?
run_vader ; err=$?
echo "Main Vader: returned $err"
o_error=$(( err | o_error ))
;;
+14 -9
View File
@@ -11,9 +11,9 @@ Given vimwiki (Markdown typeface with escape sequence #1044: _ __ * ** {{{2):
and __t \__ is still bold__ Bold 4
and _ita\_ alic continues and end_ Italic 5
*this\* \* is italic also* Italic 6
a ^t\^ is supperscrit^ Sup 7
,,sub\,, subscript end,, Sub 8
a ~~st\~~ill deleted~~ Del 9
a ^taa is supperscrit^ Sup 7
,,subaaa subscript end,, Sub 8
a ~~staaill deleted~~ Del 9
$$Eq\$$ uation follows$ Math 10
`code \` not finished inline` Code 11
@@ -26,7 +26,8 @@ Execute (Assert Syntax of escape typeface):
AssertEqual '3' , SyntaxAt(3, 14) . 3
AssertEqual 'VimwikiBold4' , SyntaxAt(4, 14) . 4
AssertEqual 'VimwikiItalic5' , SyntaxAt(5, 14) . 5
AssertEqual 'VimwikiItalic6' , SyntaxAt(6, 14) . 6
" See: #1303 where an escape start can close the region
AssertEqual '6' , SyntaxAt(6, 14) . 6
AssertEqual 'VimwikiSuperScript7', SyntaxAt(7, 14) . 7
AssertEqual 'VimwikiSubScript8' , SyntaxAt(8, 14) . 8
AssertEqual 'VimwikiDelText9' , SyntaxAt(9, 14) . 9
@@ -67,8 +68,8 @@ Given vimwiki (Markdown bad __this_not_it__ {{{2):
n4rmal_aaaaaaaaaaaaaaaaaaaa_text_ 4
n5t_italiccccccccccccccccccccc_no 5
n6t_italiccccccccccccccccccccccno 6
n7t*italiccccccccccccccccccccc_no 7
n8t*italiccccccccccccccccccccc*no 8
n7t*italiccccccccccccccccccccc*si 7
n8taitalicccccccccccccccccccccasi 8
__not_italicccccccccc_but_boldd__ 9
_a_asdasda_asdas_asdas_asdasda_a_ 10
_jitaliccccccccccccccccccccccccc_ 11
@@ -83,16 +84,20 @@ Execute (Set syntax markdown):
Execute (Assert Syntax (bravo)):
AssertEqual 'VimwikiError2' , SyntaxAt(2, 4) . 2
AssertEqual 'VimwikiError3' , SyntaxAt(3, 4) . 3
" See: #1303 where the * is now accepted in the middle of the words
" So no more trick like in _
" syn match VimwikiError "\w\@<=_\w\@=" remove the *
AssertEqual 'VimwikiDelimiter3' , SyntaxAt(3, 4) . 3
AssertEqual '4' , SyntaxAt(4, 14) . 4
AssertEqual '5' , SyntaxAt(5, 14) . 5
AssertEqual '6' , SyntaxAt(6, 14) . 6
AssertEqual '7' , SyntaxAt(7, 14) . 7
AssertEqual 'VimwikiItalic7' , SyntaxAt(7, 14) . 7
AssertEqual '8' , SyntaxAt(8, 14) . 8
AssertEqual 'VimwikiBold9' , SyntaxAt(9, 14) . 9
AssertEqual 'VimwikiItalic10' , SyntaxAt(10, 14) . 10
AssertEqual '10' , SyntaxAt(10, 14) . 10
AssertEqual 'VimwikiItalic11' , SyntaxAt(11, 14) . 11
AssertEqual '12' , SyntaxAt(12, 14) . 12
AssertEqual 'VimwikiItalic13' , SyntaxAt(13, 14) . 13
Given vimwiki (bold and pre {{{2):
__startbold
+168
View File
@@ -0,0 +1,168 @@
# Github Favor Markdown Typeface
# https://github.github.com/gfm
# 6.4 Emphasis and strong emphasis
# Rule 1 {{{1
# A single * character can open emphasis iff (if and only if) it is part of a left-flanking delimiter run.'
#################
Given vimwiki (Typeface: https://github.github.com/gfm/#example-360):
*foo bar*
Execute (Log rule):
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 2)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-361):
a * foo bar*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, because the opening * is followed by whitespace, and hence not part of a left-flanking delimiter'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-362):
todo TODO
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-363):
* a *
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Unicode nonbreaking spaces count as whitespace, too'
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-364):
foo*bar*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword emphasis with * is permitted:'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-365):
5*6*78
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
# Rule 2 {{{1
# A single _ character can open emphasis iff it is part of a left-flanking delimiter run and either (a) not part of a right-flanking delimiter run or (b) part of a right-flanking delimiter run preceded by punctuation.
#################
Given vimwiki (Typeface: https://github.github.com/gfm/#example-366):
_foo bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-367):
_ foo bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, because the opening _ is followed by whitespace'
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-368):
a_"foo"_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual '', SyntaxAt(1, 4)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-369):
foo_bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Emphasis with _ is not allowed inside words'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-370):
* 5_6_78
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-371):
CommentLine 'Not emphasis in middle even if unicode alphanumeric before left delimiter'
пристаням_стремятся_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual '', SyntaxAt(1, 22)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-372):
* aa_"bb"_cc
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Here _ does not generate emphasis, because the first delimiter run is right-flanking and the second left-flanking'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-373):
foo-_(bar)_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 7)
# vim: foldmethod=marker foldlevel=30 sw=2
+15 -4
View File
@@ -1,7 +1,6 @@
" TODO treat if local (see $HOME in all tests)
" TODO mutualise (to prettify output) mode(1) to check if in -Es or not
" TODO test tabnext in at least one travis job (without -Es)
" IDEA fasten travis difefrent job with the same vimwiki git (-8s)
" Declare tipical Vim preambule
" vint: -ProhibitSetNoCompatible
@@ -15,7 +14,9 @@
" Set chrooted virtual runtime path
let rtp = $ROOT . '/rtp.vim'
exe 'source '.rtp
if filereadable(rtp)
execute 'source ' . rtp
endif
" Load Vader
@@ -114,6 +115,14 @@
endif
" Define functions
function! CommentLine(msg)
" Log current line and argument message
" Called: in GFM copying like: https://github.github.com/gfm/#example-360 in syntax_markdown_gfm_typeface.vader
Log 'Content: `' . getline('.') . '`'
Log 'Comment: ' . a:msg
endfunction
command! -nargs=1 CommentLine call CommentLine(<args>)
function! SetSyntax(vw_syn)
" Change the syntax using a temporary wiki
" Change extension and wiki_nr
@@ -366,7 +375,9 @@
" Or rather: If execute() exists - it's not available for all 7.4
" versions.
" https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
if has('patch-7.4-2008') != 1 | return [] | endif
" Clause: Dot not work if not able
if v:version < 800 && has('patch-7.4-2008') != 1 | return [] | endif
" Store output of group to variable
let out = execute('hi ' . a:group)
@@ -379,7 +390,7 @@
endif
" Return the unique term we are looking for
let stg = matchstr(out, a:term.'=\zs[^ \t\n\r]*')
let stg = matchstr(out, a:term . '=\zs[^[:space:]]*')
return split(stg, ',')
endfunction
+16
View File
@@ -0,0 +1,16 @@
# Contents more Contents
- [Test1](#Test1)
- [Test2](#Test2)
# Test1
- [Test1](#Test1)
- [Test2](#Test2)
- [filenew](filenew)
# Test2
- [Test1](#Test1)
- [Test2](#Test2)
- [filenew](filenew)