Coder Social home page Coder Social logo

instructions for running tests about wiki.vim HOT 4 CLOSED

lervag avatar lervag commented on July 29, 2024
instructions for running tests

from wiki.vim.

Comments (4)

edrex avatar edrex commented on July 29, 2024

Also, ty for your work on this. I used vimwiki for a week before I started contemplating reimplementing the core functionality without a ftplugin, so glad someone else did it first :)

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

I spent 10 minutes poking at the makefile but I can't figure out how to run the tests. I would update doc if I knew, so if you post quick instruction here i'll clean up and PR

Hah, sorry. I've been wanting to work more on this, but currently it is at a relatively immature state (testing, that is).

Also, ty for your work on this. I used vimwiki for a week before I started contemplating reimplementing the core functionality without a ftplugin, so glad someone else did it first :)

Happy to hear it! I'm still using this very actively, and I appreciate any help with improving it. The current state of wiki.vim is quite good wrt. the features I personally need, but I think there are several possible improvements to be made that I would also benefit from.


So, to testing. For me, the following works:

cd /path/to/wiki.vim/test
make

The output is

> make
nvim -u test_journal.vim
nvim -u test_markdown.vim
nvim -u test_list.vim
nvim -u test_links.vim
nvim -u test_init.vim

Note, though, that it runs both nvim and vim. So perhaps the tests fail on your end because you don't have nvim installed?

The Makefile looks like this:

export QUIT = 1

tests := $(wildcard test_*.vim)

.PHONY: $(tests)

all: $(tests)

$(tests):
	nvim -u $@
	@vim -n -u NONE -e -s -c "source $@" 2>&1

The idea is to run all test_*.vim files, e.g. test_journal.vim, with nvim -u test_journal.vim. Since the environment variable QUIT is set to 1, the function wiki#test#quit() ensures that the script exits when it is finished.

from wiki.vim.

edrex avatar edrex commented on July 29, 2024

I have nvim and a symlink vim -> nvim. If I comment the @vim line I get

Error detected while processing /home/eric/.vim/plugged/wiki.vim/test/init.vim:
line    6:
E117: Unknown function: wiki#test#init
Error detected while processing /home/eric/.vim/plugged/wiki.vim/test/test_init.vim:
line   12:
E117: Unknown function: wiki#test#error

and then vim comes up and must be exited for each test file.

Ah, the runtime path assumes vundle is used and I'm using plug.

Fixed in #40

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

Ok, I've updated the tests quite a bit now. I've included my suggested fix for #40 as well. The testing is now much "simpler", in the sense that it mainly relies on a simple wiki#test#assert mechanism. This is a little less verbose if things fail, but the test code becomes much simpler and I think it could be possible to make the error output more verbose by utilizing stack traces if we want.

from wiki.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.