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 # 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 language: generic
cache: cache:
+8 -7
View File
@@ -15,11 +15,12 @@ WORKDIR /vader
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
# Build vim and neovim versions we want to test # Build vim and neovim versions we want to test
# TODO add nvim tag
WORKDIR / WORKDIR /
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
-tag v7.4.1099 -name vim_7.4.1099 -build \ RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build
-tag v7.4.1546 -name vim_7.4.1546 -build \ RUN install_vim -tag v7.4.1099 -name vim_7.4.1099 -build
-tag v8.0.0027 -name vim_8.0.0027 -build \ RUN install_vim -tag v7.4.1546 -name vim_7.4.1546 -build
-tag v8.1.0519 -name vim_8.1.0519 -build \ RUN install_vim -tag v8.0.0027 -name vim_8.0.0027 -build
-tag neovim:v0.3.8 -name nvim_0.3.8 -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): Do (At Index: Create and goto pythonfile):
:VimwikiIndex 2\<Cr> :VimwikiIndex 2\<Cr>
Opyfile.py\<Esc>\<Cr>\<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> :AssertEqual 'python', &ft\<CR>
:Log "Clean pyfile"\<Cr> :Log "Clean pyfile"\<Cr>
dd dd
:VimwikiIndex 2\<Cr> :VimwikiIndex 2\<Cr>
:call DeleteFile('pyfile.py')\<Cr> " :call DeleteFile('pyfile.py')\<Cr>
Do (At Index: Create and goto markdownfile): Do (At Index: Create and goto markdownfile):
@@ -22,6 +23,6 @@ Do (At Index: Create and goto markdownfile):
:Log "Clean mdfile"\<Cr> :Log "Clean mdfile"\<Cr>
:VimwikiIndex 2\<Cr> :VimwikiIndex 2\<Cr>
dd dd
:call DeleteFile('mdfile.md')\<Cr> " :call DeleteFile('mdfile.md')\<Cr>
# vim: sw=2:foldmethod=marker:foldlevel=30:foldignore=: # 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): Execute (Set syntax markdown):
call SetSyntax('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): Do (Enter link):
gg\<Cr> gg\<Cr>
A__HERE1__\<Esc> A__HERE1__\<Esc>
ggj\<Cr> ggj\<Cr>
A__HERE2__\<Esc> A__HERE2__\<Esc>
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
Expect(): Expect(Some suffix added after headings):
[link1](#i-v-p-741528) [link1](#i-v-p-741528)
[link2](#i-v-p-741528-2) [link2](#i-v-p-741528-2)
@@ -192,6 +201,9 @@ Given vimwiki (Internal links + one link to filenew):
Execute (Set filename wiki_test.md): Execute (Set filename wiki_test.md):
call SetSyntax('markdown') call SetSyntax('markdown')
Execute (Set filename wiki_test.md):
file wiki_test.md
Do (Navigate with <Tab>): Do (Navigate with <Tab>):
A more Contents\<Esc> A more Contents\<Esc>
\<Tab> \<Tab>
@@ -201,6 +213,7 @@ Do (Navigate with <Tab>):
\<Tab> \<Tab>
\<Enter> \<Enter>
A more Test2\<Esc> A more Test2\<Esc>
:AssertEqual 'wiki_test.md', expand('%')\<Cr>
Expect (Content added to titles): Expect (Content added to titles):
# Contents more Contents # Contents more Contents
@@ -231,9 +244,23 @@ Do (Navigate with <Tab> and <Enter> and come back with <Bs>):
\<Tab> \<Tab>
\<Tab> \<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 # 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> \<Bs>
:Log 'Debugging 2, cursor position list'\<Cr>
:Log vimwiki#vars#get_bufferlocal('prev_links')\<Cr>
# Cursor at Test1/test2 # Cursor at Test1/test2
A near Test1/test2 A near Test1/test2
\<Esc> \<Esc>
@@ -260,51 +287,70 @@ Expect (Vimwiki links):
- [Test2](#Test2) - [Test2](#Test2)
- [filenew](filenew) not yet - [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 #Do (Navigate with <Tab> comeback with <Bs> from filenew):
# \<Tab>
- [Test1](#Test1) # A first shot\<Esc>
- [Test2](#Test2) # 0\<Tab>
- [filenew](filenew) first shot ## 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): Execute (Delete filenew buffer):
call DeleteFile('/testplugin/filenew.md') call DeleteFile('/testplugin/filenew.md')
@@ -312,22 +358,22 @@ Execute (Delete filenew buffer):
Do (Navigate with <Tab> comeback with <Bs> too far): Do (Navigate with <Tab> comeback with <Bs> too far):
\<Tab> \<Tab>
# Cursor at Contents/test1 # Cursor at Contents/test1
\<Enter> \<Cr>
\<Tab> \<Tab>
\<Tab> \<Tab>
# Cursor at Test1/test2 # Cursor at Test1/test2
\<Enter> \<Cr>
\<Tab> \<Tab>
# Cursor at Test2/test1 # Cursor at Test2/test1
\<Enter> \<Cr>
\<Tab> \<Tab>
\<Tab> \<Tab>
# Cursor at Test1/test2 # Cursor at Test1/test2
\<Enter> \<Cr>
A first test2\<Esc> A first test2\<Esc>
\<Tab> \<Tab>
# Cursor at Test2/test1 # Cursor at Test2/test1
\<Enter> \<Cr>
A first test1\<Esc> A first test1\<Esc>
# Back # Back
\<Bs> \<Bs>
@@ -355,7 +401,7 @@ Do (Navigate with <Tab> comeback with <Bs> too far):
\<Bs> \<Bs>
A 4\<Esc> 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 # Contents
- [Test1](#Test1) 1 2 3 4 - [Test1](#Test1) 1 2 3 4
@@ -382,7 +428,7 @@ Given vimwiki (link to self):
Do (Follow link to self and append chars): Do (Follow link to self and append chars):
\<Tab> \<Tab>
\<Tab> \<Tab>
\<Enter> \<Cr>
a this_is_18_chars \<Esc> a this_is_18_chars \<Esc>
Expect (Some chars appended at self link): Expect (Some chars appended at self link):
+9 -8
View File
@@ -38,19 +38,19 @@ Given vimwiki (filename filename.dot):
filename filename
filename.dot filename.dot
Do(): Do (Press filename):
:call SetSyntax('default')\<CR> :call SetSyntax('default')\<CR>
\<CR>\<CR> \<CR>\<CR>
:AssertEqual 'filename.wiki', expand('%:t')\<CR> :AssertEqual 'filename.wiki', expand('%:t')\<CR>
:call DeleteFile('%')\<CR> :call DeleteFile('%')\<CR>
Do(): Do (Press filename.dot):
j j
\<CR>\<CR> \<CR>\<CR>
:AssertEqual 'filename.dot', expand('%:t')\<CR> :AssertEqual 'filename.dot.wiki', expand('%:t')\<CR>
:call DeleteFile('%')\<CR> :call DeleteFile('%')\<CR>
Expect(Nothing left): Expect (Nothing left):
# Linkify function {{{1 # Linkify function {{{1
@@ -331,13 +331,14 @@ Given vimwiki (filnames with dots):
part1.part2.part3.md part1.part2.part3.md
noext noext
Do (Fllow link witout markdown): Do (Follow link witout markdown):
\<Cr>\<Cr> \<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> j\<Cr>\<Cr>
:AssertEqual expand('%:t'), 'part1.part2.part3.md'\<Cr> :AssertEqual 'part1.part2.part3.md', expand('%:t')\<Cr>
# Rest {{{1 # Rest {{{1
+8 -3
View File
@@ -161,9 +161,14 @@ Do (Create in_root):
0\<CR>\<CR> 0\<CR>\<CR>
:AssertEqual 'file ' . $HOME . '/testmarkdown/dir1/dir11/in_dir11.md', 'file ' . expand('%')\<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): Do (Create dir_11 -> dir_11):
+259 -249
View File
@@ -7,199 +7,211 @@
echo -en "Starting $(basename "$0") for VimWiki\n" echo -en "Starting $(basename "$0") for VimWiki\n"
start_time=$(date +%s) 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 # For windows: Cmder bash is appending busybox to the path and
# and a smlll vim is included, so that override the windows path vim # and a smlll vim is included, so that override the windows path vim
if [[ -v OLD_PATH ]]; then if [[ -v OLD_PATH ]]; then
echo "Setting path from OLD_PATH : $OLD_PATH" echo "Setting path from OLD_PATH : $OLD_PATH"
export PATH="$OLD_PATH" export PATH="$OLD_PATH"
fi fi
printHelp() { printHelp() {
cat << ' EOF' | sed -e 's/^ //' cat << ' EOF' | sed -e 's/^ //'
Usage: bash run_tests.sh [OPTIONS] Usage: bash run_tests.sh [OPTIONS]
Runs Vimwiki Vader tests or Vint in a Docker container Runs Vimwiki Vader tests or Vint in a Docker container
-h (Help) Print help message -h (Help) Print help message
-n (versioN) Specify vim/nvim version to run tests for. -n (versioN) Specify vim/nvim version to run tests for.
Specify "local" to run on your current vim install Specify "local" to run on your current vim install
for example on Windows. for example on Windows.
Multiple versions can be specified by quoting the value and Multiple versions can be specified by quoting the value and
separating versions with a space. E.g. -n "vim1 vim2". separating versions with a space. E.g. -n "vim1 vim2".
Default is all available versions. Default is all available versions.
-f (File) Space separated list of tests to run. -f (File) Space separated list of tests to run.
E.g. -o "list_* z_success" E.g. -o "list_* z_success"
-l (List) list available versions that can be used with the '-n' option -l (List) list available versions that can be used with the '-n' option
-t (Type) Select test type: 'vader', 'vint', or 'all' -t (Type) Select test type: 'vader', 'vint', or 'all'
-v (Verbose) Turn on verbose output. -v (Verbose) Turn on verbose output.
E.g. On Linux E.g. On Linux without with local Vim
bash run_tests.sh -v -t vader -n "vim_7.4.1099 vim_8.1.0519" -f link_creation.vader issue_markdown.vader bash run_tests.sh -v -t vader -n local -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
exit 0 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
exit 0
} }
printVersions() {
# Print the names of all vim/nvim versions print_versions() {
getVers # Print the names of all vim/nvim versions
exit 0 # Get all possible version <- Dockerfile
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile
exit 0
} }
runVader() {
# Run Vader tests
echo -e "\nStarting Vader tests."
local err=0
# Parse tests files to execute run_vader() {
if [[ -z $file_test ]]; then # Run Vader tests
res="test/*" echo -e "\nStarting Vader tests."
else local err=0
read -ra TEST <<< "$file_test"
for i in "${TEST[@]}"; do
if [[ "$i" == *"*"* ]]; then
res="$res test/${i}"
elif [[ -f "$i" ]]; then
res="$res test/${i}"
elif [[ -f "${i}.vader" ]]; then
res="$res test/${i}.vader"
else
printf "WARNING: Test \"%s\" not found.\n", "$i"
fi
done
fi
# Run tests for each specified version # Parse tests files to execute
for v in $vers; do if [[ -z $file_test ]]; then
echo -e "\n\nRunning version: $v" res="test/*"
echo -e "=============================" else
read -ra TEST <<< "$file_test"
# Set local environment variables for i in "${TEST[@]}"; do
if [[ "$v" == "local" ]]; then # Remove quotes
# Save HOME var i=${i#\'}
home_save="$HOME" i=${i%\'}
if [[ "$i" == *"*"* ]]; then
# Create temporary root res="$res test/${i}"
mkdir -p "$tmp_dir/vader_wiki" elif [[ -f "$i" ]]; then
mkdir -p "$tmp_dir/vader_wiki/home" res="$res test/${i}"
mkdir -p "$tmp_dir/vader_wiki/home/test" elif [[ -f "${i}.vader" ]]; then
mkdir -p "$tmp_dir/vader_wiki/testplugin" res="$res test/${i}.vader"
else
# Set vars printf "WARNING: Test \"%s\" not found.\n", "$i"
export ROOT="$tmp_dir/vader_wiki/" fi
export HOME="$tmp_dir/vader_wiki/home"
vim="vim"
vim_opt="-u ~/test/vimrc"
else
# Only set dockerized vars
export ROOT="/" # So no if in vimrc
vim="/vim-build/bin/$v"
vim_opt="-u test/vimrc"
fi
# Too talkative TODO make a verbose level 1..10 an 1 is not taking vim
#if [[ "$verbose" != 0 ]]; then
# vim_opt+=' -V1'
#fi
# IDK why vim with -Es is returning ! and make fail:
# -- tabnext profiling
# -- map.vim
vim_opt+=' -i NONE -Es '
# set -o pipefail
# Copy the resources to temporary directory
if [[ "$v" == "local" ]]; then
# flags=(--rm -v "$PWD/../:/testplugin" -v "$PWD/../test:/home" -w /testplugin vimwiki)
echo -e "\nCopying resources to $ROOT"
# Copy testplugin
cp -rf "$wiki_path/"* "$ROOT/testplugin/"
# Copy home
cp -rf "$script_path/"* "$HOME/test/"
# Copy rtp.vim
cp -rf "$script_path/resources/rtp_local.vim" "$ROOT/rtp.vim"
# Copy vader <- internet
echo 'Cloning Vader (git, do not care the fatal)'
git clone --depth 10 https://github.com/junegunn/vader.vim /tmp/vader_wiki/vader 2>&1
fi
# Run batch of tests
# shellcheck disable=SC2086,SC2206
if [[ "$res" != "" ]]; then
if [[ "$v" == "local" ]]; then
pushd "$tmp_dir/vader_wiki/testplugin" \
|| echo 'Warning pushd testplugin failed'
# Run the tests
fcmd(){
$vim $vim_opt "+Vader! ${res}" 2>&1
return ${PIPESTATUS[1]}
}
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
type fcmd | sed -n '/^ /{s/^ //p}' | sed '$s/.*/&;/' ; shift ;
fcmd; ret=$?
err=$(( err + ret ))
echo -e "\nReturned Batch Vim/Vader -> $ret"
popd \
|| echo 'Warning popd also failed'
else
# In docker
fcmd() {
docker run -a stderr -e "VADER_OUTPUT_FILE=/dev/stderr" \
"${flags[@]}" "$v" $vim_opt "+Vader! ${res}" 2>&1 \
| vader_filter | vader_color
return ${PIPESTATUS[1]}
}
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
type fcmd | sed -n '/^ /{s/^ //p}' | sed '$s/.*/&;/' ; shift ;
fcmd; ret=$?
err=$(( err + ret ))
echo -e "\nReturned Batch Docker/Vim/Vader -> $ret : ${PIPESTATUS[*]}"
fi
fi
#set +o pipefail
# Restore what must (I know it should be refactored in a while)
if [[ "$v" == "local" ]]; then
export HOME=$home_save
fi
done done
return $err fi
}
runVint() { # Run tests for each specified version
local err=0 for v in $vers; do
cmd="vint -s . && vint -s test/vimrc" echo -e "\n\nRunning version: $v"
if echo "$vers" | grep "local" > /dev/null; then echo -e "============================="
echo -e "\nRunning Vint: $cmd : in $wiki_path"
pushd "$wiki_path" > /dev/null \ # Set local environment variables
|| echo 'Warning pushd wiki_path failed' if [[ "$v" == "local" ]]; then
$cmd # Save HOME var
err=$(( err | $? )) home_save="$HOME"
popd > /dev/null \
|| echo 'Warning popd also failed' # Create temporary root
mkdir -p "$tmp_dir/vader_wiki"
mkdir -p "$tmp_dir/vader_wiki/home"
mkdir -p "$tmp_dir/vader_wiki/home/test"
mkdir -p "$tmp_dir/vader_wiki/testplugin"
# Set vars
export ROOT="$tmp_dir/vader_wiki/"
export HOME="$tmp_dir/vader_wiki/home"
vim="vim"
vim_opt="-u ~/test/vimrc"
else else
echo -e "\nStarting Docker container and running Vint: $cmd" # Only set dockerized vars
docker run -a stdout "${flags[@]}" bash -c "$cmd" export ROOT="/" # So no if in vimrc
err=$(( err | $? )) vim="/vim-build/bin/$v"
vim_opt="-u test/vimrc"
fi fi
return $err
# Too talkative TODO make a verbose level 1..10 an 1 is not taking vim
#if [[ "$verbose" != 0 ]]; then
# vim_opt+=' -V1'
#fi
# IDK why vim with -Es is returning ! and make fail:
# -- tabnext profiling
# -- map.vim
vim_opt+=' -i NONE -Es '
# set -o pipefail
# Copy the resources to temporary directory
if [[ "$v" == "local" ]]; then
# flags=(--rm -v "$PWD/../:/testplugin" -v "$PWD/../test:/home" -w /testplugin vimwiki)
echo -e "\nCopying resources to $ROOT"
# Copy testplugin
cp -rf "$wiki_path/"* "$ROOT/testplugin/"
# Copy home
cp -rf "$script_path/"* "$HOME/test/"
# Copy rtp.vim
cp -rf "$script_path/resources/rtp_local.vim" "$ROOT/rtp.vim"
# Copy vader <- internet
echo 'Cloning Vader (git, do not care the fatal)'
git clone --depth 10 https://github.com/junegunn/vader.vim /tmp/vader_wiki/vader 2>&1
fi
# Run batch of tests
# shellcheck disable=SC2086,SC2206
if [[ "$res" != "" ]]; then
if [[ "$v" == "local" ]]; then
pushd "$tmp_dir/vader_wiki/testplugin" \
|| echo 'Warning pushd testplugin failed'
# Run the tests
fcmd(){
$vim $vim_opt "+Vader! ${res}" 2>&1 \
| vader_filter | vader_color
return ${PIPESTATUS[1]}
}
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
type fcmd | sed -n '/^ /{s/^ //p}' | sed '$s/.*/&;/' ; shift ;
fcmd; ret=$?
err=$(( err + ret ))
echo -e "\nReturned Batch Vim/Vader -> $ret"
popd \
|| echo 'Warning popd also failed'
else
# In docker
fcmd() {
docker run -a stderr -e "VADER_OUTPUT_FILE=/dev/stderr" \
"${flags[@]}" "$v" $vim_opt "+Vader! ${res}" 2>&1 \
| vader_filter | vader_color
return ${PIPESTATUS[1]}
}
echo -e "\nStarting Batch Vim/Vader:\n<- $res\n"
type fcmd | sed -n '/^ /{s/^ //p}' | sed '$s/.*/&;/' ; shift ;
fcmd; ret=$?
err=$(( err + ret ))
echo -e "\nReturned Batch Docker/Vim/Vader -> $ret : ${PIPESTATUS[*]}"
fi
fi
#set +o pipefail
# Restore what must (I know it should be refactored in a while)
if [[ "$v" == "local" ]]; then
export HOME=$home_save
fi
done
return $err
} }
getVers() {
# Get all possible version <- Dockerfile run_vint() {
sed -n 's/.* -name \([^ ]*\) .*/\1/p' ../Dockerfile local err=0
cmd="vint -s . && vint -s test/vimrc"
if echo "$vers" | grep "local" > /dev/null; then
echo -e "\nRunning Vint: $cmd : in $wiki_path"
pushd "$wiki_path" > /dev/null \
|| echo 'Warning pushd wiki_path failed'
$cmd
err=$(( err | $? ))
popd > /dev/null \
|| echo 'Warning popd also failed'
else
echo -e "\nStarting Docker container and running Vint: $cmd"
docker run -a stdout "${flags[@]}" bash -c "$cmd"
err=$(( err | $? ))
fi
return $err
} }
vader_filter() { vader_filter() {
# Filter Vader Stdout # Filter Vader Stdout
local err=0 local err=0
@@ -208,14 +220,15 @@ vader_filter() {
while read -r REPLY; do while read -r REPLY; do
# Print only possible error cases # Print only possible error cases
if [[ "$REPLY" = *'docker:'* ]] || \ if [[ "$REPLY" = *'docker:'* ]] || \
[[ "$REPLY" = *'Starting Vader:'* ]] || \ [[ "$REPLY" = *'Starting Vader:'* ]] || \
[[ "$REPLY" = *'Vader error:'* ]] || \ [[ "$REPLY" = *'Vader error:'* ]] || \
[[ "$REPLY" = *'Vim: Error '* ]]; then [[ "$REPLY" = *'Vim: Error '* ]]; then
echo "$REPLY" echo "$REPLY"
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \ elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
[[ "$REPLY" = *'[ DO] (X)'* ]] || \
[[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then [[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
echo "$REPLY" echo -e "$red$REPLY$nc"
err=1 err=1
elif [[ "$REPLY" = *'Success/Total:'* ]]; then elif [[ "$REPLY" = *'Success/Total:'* ]]; then
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)" success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)" total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)"
@@ -239,38 +252,35 @@ vader_filter() {
} }
red='\033[0;31m'
green='\033[0;32m'
nc='\033[0m'
vader_color() { vader_color() {
while read -r; do while read -r; do
if [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \ if [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
[[ "$REPLY" = *'[ EXPECT] (X)'* ]] || \ [[ "$REPLY" = *'[ EXPECT] (X)'* ]] || \
[[ "$REPLY" = *'Vim: Error '* ]] || \ [[ "$REPLY" = *'Vim: Error '* ]] || \
[[ "$REPLY" = *'Vader error:'* ]]; then [[ "$REPLY" = *'Vader error:'* ]]; then
echo -en "$red" echo -en "$red"
elif [[ "$REPLY" = *'[EXECUTE]'* ]] || [[ "$REPLY" = *'[ GIVEN]'* ]]; then elif [[ "$REPLY" = *'[EXECUTE]'* ]] || [[ "$REPLY" = *'[ GIVEN]'* ]]; then
echo -en "$nc" echo -en "$nc"
fi fi
if [[ "$REPLY" = *'Success/Total'* ]]; then if [[ "$REPLY" = *'Success/Total'* ]]; then
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)" success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)" total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)"
if [ "$success" -lt "$total" ]; then if [ "$success" -lt "$total" ]; then
echo -en "$red" echo -en "$red"
else else
echo -en "$green" echo -en "$green"
fi fi
echo "$REPLY" echo "$REPLY"
echo -en "$nc" echo -en "$nc"
else else
echo "$REPLY" echo "$REPLY"
fi fi
done done
echo -en "$nc" echo -en "$nc"
} }
# path of the script, supposing no spaces # path of the script, supposing no spaces
@@ -280,7 +290,7 @@ wiki_path="$( realpath "$script_path/.." )"
tmp_dir="$(dirname "$(mktemp -u)")" tmp_dir="$(dirname "$(mktemp -u)")"
# list of vim/nvim versions # list of vim/nvim versions
vers="$(getVers)" vers="$(print_versions)"
# type of tests to run - vader/vint/all # type of tests to run - vader/vint/all
type="all" type="all"
@@ -295,34 +305,34 @@ file_test=""
flags=(--rm -v "$PWD/../:/testplugin" -v "$PWD/../test:/home" -w /testplugin vimwiki) flags=(--rm -v "$PWD/../:/testplugin" -v "$PWD/../test:/home" -w /testplugin vimwiki)
while getopts ":hvn:lt:f:" opt; do while getopts ":hvn:lt:f:" opt; do
case ${opt} in case ${opt} in
h ) h)
printHelp printHelp
;; ;;
n ) n)
vers="$OPTARG" vers="$OPTARG"
;; ;;
v ) v)
verbose=1 verbose=1
;; ;;
l ) l)
printVersions print_versions
;; ;;
t ) t)
type="$OPTARG" type="$OPTARG"
;; ;;
f ) f)
file_test="$OPTARG" file_test="$OPTARG"
;; ;;
\? ) \?)
echo "Invalid option: $OPTARG" 1>&2 echo "Invalid option: $OPTARG" 1>&2
exit 1 exit 1
;; ;;
: ) :)
echo "Invalid option: $OPTARG requires an argument" 1>&2 echo "Invalid option: $OPTARG requires an argument" 1>&2
exit 1 exit 1
;; ;;
esac esac
done done
# shift out processed parameters # shift out processed parameters
@@ -330,8 +340,8 @@ shift $((OPTIND -1))
# error handling for non-option arguments # error handling for non-option arguments
if [[ $# -ne 0 ]]; then if [[ $# -ne 0 ]]; then
echo "Error: Got $# non-option arguments." 1>&2 echo "Error: Got $# non-option arguments." 1>&2
exit 1 exit 1
fi fi
# stop tests on ctrl-c or ctrl-z # stop tests on ctrl-c or ctrl-z
@@ -342,27 +352,27 @@ o_error=0
# Select which tests should run # Select which tests should run
case $type in case $type in
"vader" ) vader)
runVader ; err=$? run_vader ; err=$?
echo "Main Vader: returned $err" echo "Main Vader: returned $err"
o_error=$(( err | o_error )) o_error=$(( err | o_error ))
;; ;;
"vint" ) vint)
runVint ; err=$? run_vint ; err=$?
echo "Main Vint: returned $err" echo "Main Vint: returned $err"
o_error=$(( err | o_error )) o_error=$(( err | o_error ))
;; ;;
"all" ) all)
runVint ; err=$? run_vint ; err=$?
echo "Main Vint: returned $err" echo "Main Vint: returned $err"
o_error=$(( err | o_error )) o_error=$(( err | o_error ))
runVader ; err=$? run_vader ; err=$?
echo "Main Vader: returned $err" echo "Main Vader: returned $err"
o_error=$(( err | o_error )) o_error=$(( err | o_error ))
;; ;;
* ) *)
echo "Error: invalid type - '$type'" 1>&2 echo "Error: invalid type - '$type'" 1>&2
exit 1 exit 1
esac esac
# Calcultate time # Calcultate time
+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 __t \__ is still bold__ Bold 4
and _ita\_ alic continues and end_ Italic 5 and _ita\_ alic continues and end_ Italic 5
*this\* \* is italic also* Italic 6 *this\* \* is italic also* Italic 6
a ^t\^ is supperscrit^ Sup 7 a ^taa is supperscrit^ Sup 7
,,sub\,, subscript end,, Sub 8 ,,subaaa subscript end,, Sub 8
a ~~st\~~ill deleted~~ Del 9 a ~~staaill deleted~~ Del 9
$$Eq\$$ uation follows$ Math 10 $$Eq\$$ uation follows$ Math 10
`code \` not finished inline` Code 11 `code \` not finished inline` Code 11
@@ -26,7 +26,8 @@ Execute (Assert Syntax of escape typeface):
AssertEqual '3' , SyntaxAt(3, 14) . 3 AssertEqual '3' , SyntaxAt(3, 14) . 3
AssertEqual 'VimwikiBold4' , SyntaxAt(4, 14) . 4 AssertEqual 'VimwikiBold4' , SyntaxAt(4, 14) . 4
AssertEqual 'VimwikiItalic5' , SyntaxAt(5, 14) . 5 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 'VimwikiSuperScript7', SyntaxAt(7, 14) . 7
AssertEqual 'VimwikiSubScript8' , SyntaxAt(8, 14) . 8 AssertEqual 'VimwikiSubScript8' , SyntaxAt(8, 14) . 8
AssertEqual 'VimwikiDelText9' , SyntaxAt(9, 14) . 9 AssertEqual 'VimwikiDelText9' , SyntaxAt(9, 14) . 9
@@ -67,8 +68,8 @@ Given vimwiki (Markdown bad __this_not_it__ {{{2):
n4rmal_aaaaaaaaaaaaaaaaaaaa_text_ 4 n4rmal_aaaaaaaaaaaaaaaaaaaa_text_ 4
n5t_italiccccccccccccccccccccc_no 5 n5t_italiccccccccccccccccccccc_no 5
n6t_italiccccccccccccccccccccccno 6 n6t_italiccccccccccccccccccccccno 6
n7t*italiccccccccccccccccccccc_no 7 n7t*italiccccccccccccccccccccc*si 7
n8t*italiccccccccccccccccccccc*no 8 n8taitalicccccccccccccccccccccasi 8
__not_italicccccccccc_but_boldd__ 9 __not_italicccccccccc_but_boldd__ 9
_a_asdasda_asdas_asdas_asdasda_a_ 10 _a_asdasda_asdas_asdas_asdasda_a_ 10
_jitaliccccccccccccccccccccccccc_ 11 _jitaliccccccccccccccccccccccccc_ 11
@@ -83,16 +84,20 @@ Execute (Set syntax markdown):
Execute (Assert Syntax (bravo)): Execute (Assert Syntax (bravo)):
AssertEqual 'VimwikiError2' , SyntaxAt(2, 4) . 2 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 '4' , SyntaxAt(4, 14) . 4
AssertEqual '5' , SyntaxAt(5, 14) . 5 AssertEqual '5' , SyntaxAt(5, 14) . 5
AssertEqual '6' , SyntaxAt(6, 14) . 6 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 '8' , SyntaxAt(8, 14) . 8
AssertEqual 'VimwikiBold9' , SyntaxAt(9, 14) . 9 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 'VimwikiItalic11' , SyntaxAt(11, 14) . 11
AssertEqual '12' , SyntaxAt(12, 14) . 12 AssertEqual '12' , SyntaxAt(12, 14) . 12
AssertEqual 'VimwikiItalic13' , SyntaxAt(13, 14) . 13
Given vimwiki (bold and pre {{{2): Given vimwiki (bold and pre {{{2):
__startbold __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
+18 -7
View File
@@ -1,7 +1,6 @@
" TODO treat if local (see $HOME in all tests) " TODO treat if local (see $HOME in all tests)
" TODO mutualise (to prettify output) mode(1) to check if in -Es or not " 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) " 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 " Declare tipical Vim preambule
" vint: -ProhibitSetNoCompatible " vint: -ProhibitSetNoCompatible
@@ -14,12 +13,14 @@
let $THOME = $HOME let $THOME = $HOME
" Set chrooted virtual runtime path " Set chrooted virtual runtime path
let rtp=$ROOT.'/rtp.vim' let rtp = $ROOT . '/rtp.vim'
exe 'source '.rtp if filereadable(rtp)
execute 'source ' . rtp
endif
" Load Vader " Load Vader
let vader=$ROOT.'/vader' let vader = $ROOT.'/vader'
exe 'set runtimepath+='.vader exe 'set runtimepath+='.vader
@@ -114,6 +115,14 @@
endif endif
" Define functions " 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) function! SetSyntax(vw_syn)
" Change the syntax using a temporary wiki " Change the syntax using a temporary wiki
" Change extension and wiki_nr " Change extension and wiki_nr
@@ -366,7 +375,9 @@
" Or rather: If execute() exists - it's not available for all 7.4 " Or rather: If execute() exists - it's not available for all 7.4
" versions. " versions.
" https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a " 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 " Store output of group to variable
let out = execute('hi ' . a:group) let out = execute('hi ' . a:group)
@@ -378,8 +389,8 @@
return GetHighlightTerm(parent, a:term) return GetHighlightTerm(parent, a:term)
endif endif
" Return the unique term we are looking for " 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, ',') return split(stg, ',')
endfunction 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)