From 61bf093abc259a1a3073c4dd63e5026bd14c0f1e Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Wed, 28 Sep 2022 03:18:38 +0200 Subject: [PATCH] Add test with vader --- README.md | 9 ++++++ bin/test | 7 +++++ test/extract_variable.vader | 61 +++++++++++++++++++++++++++++++++++++ test/fixtures/vimrc | 14 +++++++++ 4 files changed, 91 insertions(+) create mode 100755 bin/test create mode 100644 test/extract_variable.vader create mode 100644 test/fixtures/vimrc diff --git a/README.md b/README.md index 74ce965..70173a7 100644 --- a/README.md +++ b/README.md @@ -381,3 +381,12 @@ class Foo { `da` will call your documentation plugin (by default Php Documentor for vim https://github.com/tobyS/pdv) for every uncommented classes, methods, functions and properties. +## Running tests + +``` +bin/test +``` + +### How to write tests? + +See https://github.com/junegunn/vader.vim diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..f670198 --- /dev/null +++ b/bin/test @@ -0,0 +1,7 @@ +#! /bin/sh -eu + +test -d vendor/vader.vim || { + git clone --depth=1 https://github.com/junegunn/vader.vim.git vendor/vader.vim +} + +vim -esNu test/fixtures/vimrc -c 'Vader! test/*' diff --git a/test/extract_variable.vader b/test/extract_variable.vader new file mode 100644 index 0000000..6893262 --- /dev/null +++ b/test/extract_variable.vader @@ -0,0 +1,61 @@ +Given php (condition on if): + + vi( + ;ev + firstNameIsValid\ + +Expect php (variable is extracted): + + vi( + ;ev + firstNameIsValid\ + +Expect php (variable is extracted): +