mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 20:13:46 -05:00
Refactor tests to be isolated.
This commit is contained in:
18
test/test.sh
18
test/test.sh
@@ -1,13 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: exit with non-zero status code when tests fail.
|
||||
# TODO: quit vim after each testcase inside loop below (instead of in testcase).
|
||||
|
||||
rm -f *.out
|
||||
|
||||
# Run the tests.
|
||||
vim -N -u NONE -S test.vim
|
||||
|
||||
# Verify the outputs.
|
||||
for expected in *.ok; do
|
||||
name=${expected%.*}
|
||||
for testcase in test*.vim; do
|
||||
vim -N -u NONE -S $testcase # testFoo.vim
|
||||
testname=${testcase%.*} # testFoo
|
||||
name=${testname:4} # Foo
|
||||
name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" # foo
|
||||
expected=$name.ok
|
||||
actual=$name.out
|
||||
diff $expected $actual && echo "$name ok" || echo "$name failed"
|
||||
done
|
||||
|
||||
git checkout fixture.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user