Skip to content

Commit

Permalink
fix vader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sysid committed Aug 25, 2024
1 parent 8de1ab2 commit 45f18bf
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ test: ## run tests
#test-vim: test-vim-uri ## run tests-vim

.PHONY: test-vim-uri
test-vim-uri: build-vim ## run tests-vim-vimania (requires libs in pythonx: make build-vim
test-vim-uri: build-vim ## run tests-vim-vimania (requires libs in pythonx: make build-vim)
@echo "- > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > "
pushd tests; ./run_test.sh test_vimania_uri_rs.vader; popd
pushd tests; ./run_test.sh test_vimania_uri.vader; popd
@echo "- < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < "

################################################################################
Expand Down
14 changes: 7 additions & 7 deletions tests/run_manual_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ if [ -z "$1" ]; then
exit 1
fi

TW_XXX_DB_URL=sqlite:///data/vader.db vim -Nu <(cat << EOF
vim -Nu <(cat << EOF
filetype off
set rtp+=~/.vim/plugged/vader.vim
set rtp+=~/.vim/plugged/vim-misc
set rtp+=~/.vim/plugged/scriptease
set rtp+=~/.vim/plugged/vim-textobj-user
set rtp+=~/dev/vim/tw-vim
set rtp+=~/dev/vim/vimania
set rtp+=~/dev/vim/vimania-uri-rs
filetype plugin indent on
syntax enable
" TWBM INTEGRATION:
let g:vimania_uri_twbm_integration=1
" URI extensions
let g:vimania_uri_extensions=['.md', '.txt', '.py']
let g:twvim_debug = 1
let g:os = 'Darwin'
if g:twvim_debug | echom "-D- Debugging is activated." | endif
" required by tw-vim
let g:twvim_config = {
\ 'diary_path': '/Users/Q187392/vimwiki/diary',
\ }
" to aovid prompting
set shortmess+=at
"set cmdheight=200
Expand Down
4 changes: 2 additions & 2 deletions tests/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ fi
# main
################################################################################
#prep-db # no DB required
prep-twbm
#prep-twbm

vim -Nu <(cat << EOF
filetype off
set rtp+=~/.vim/plugged/vader.vim
set rtp+=~/.vim/plugged/vim-misc
set rtp+=~/.vim/plugged/scriptease
set rtp+=~/dev/vim/tw-vim
set rtp+=~/dev/vim/vimania-uri
set rtp+=~/dev/vim/vimania-uri-rs
filetype plugin indent on
syntax enable
Expand Down
46 changes: 16 additions & 30 deletions tests/test_vimania_uri.vader
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
Before:
messages clear

Given (test-buffer text):
yyy://$HOME/dev/vim/vim-textobj-uri/test/vimania//vimania.pdf

#Execute(Should open marked2 viewer):
# Vimania $HOME/dev/vim/vimania-todos/tests/data/test.md 0
# "Vimania /Users/Q187392/dev/vim/vimania-todos/tests/data/test.md
Expand All @@ -21,27 +18,23 @@ Do(add twbm: prereq: make sure www.google.com does not exist int twbm prod):
goo
Then ():
Messages
Cfilter add_twbm
Log printf("Len of location list: %s", len(getqflist()))
Assert len(getqflist()) == 1
Cfilter added successfully
Log printf("Len of quickfix list: %s", len(getqflist()))
Assert len(getqflist()) >= 1

# TODO: check DB for deletion
Given markdown (should delete non existing entry in twbm):
wiht a [url](vm::http://www.vimania.tw) some more text
Do (delete line):
dd
Then ():
Log printf("Current Line: %s", getline('.'))
Assert 1 == line('$')
Assert "" == getline('.')
Execute(twbm_delete):
VimaniaDeleteTwbm with [url](vm::http://www.vimania.tw) some more text
Then ():
Messages
"Cfilter deleted
Cfilter not in DB
Log printf("Len of location list: %s", len(getqflist()))
Assert len(getqflist()) == 1
# GOTCHA: yes prompt not working
#Given markdown (should delete non existing entry in twbm):
# wiht a [url](http://www.vimania.tw) some more text
#Do (delete line):
# ddy\<Enter>
#Then ():
# Log printf("Current Line: %s", getline('.'))
# Assert 1 == line('$')
# Assert "" == getline('.')
# Messages
# Cfilter filter deleted twbm: 0
# Log printf("Len of quickfix list: %s", len(getqflist()))
# Assert len(getqflist()) == 1

Given markdown (with TOC anchors):
[Scond Heading](#second-heading)
Expand All @@ -64,10 +57,3 @@ Then (https://sysid.github.io/ opens in Browser Tab):
Cfilter browser
Log printf("Len of location list: %s", len(getqflist()))
Assert len(getqflist()) >= 1

Execute(markdown edit with jump to heading1):
VimaniaEdit /Users/Q187392/dev/vim/vimania-uri/tests/data/test.md# Working Examples
"VimaniaEdit /Users/Q187392/dev/vim/vimania-todos/tests/data/test.md## Config
Then ():
Log printf("Current Line: %s", getline('.'))
Assert "# Working Examples" == getline('.')
25 changes: 1 addition & 24 deletions tests/x.md
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
[xxx](# yyy)

wiht a [url](vm::http://www.vimania.tw) some more text
wiht a [url](vm::http://www.vimania.tw) some more text
wiht a [url](vm::http://www.vimania.tw) some more text

vm::http://www.vimania.tw
vm::http://www.vimania.tw

http://www.vimania.tw
https://www.google.com

[Goto Scond Heading](#second-heading)
Github: [bash-completion](https://github.com/scop/bash-completion)

# yyy

## Second Heading

[reference link][label]

[label]: https://www.google.com

[Google](https://www.google.com/)
wiht a [url](http://www.vimania.tw) some more text

0 comments on commit 45f18bf

Please sign in to comment.