mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-11 04:53:46 -05:00
Drop extension for bash script.
This commit is contained in:
41
test/test
Executable file
41
test/test
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: exit with non-zero status code when tests fail.
|
||||
|
||||
|
||||
# Clean up.
|
||||
rm -f *.actual
|
||||
|
||||
# Execute the tests.
|
||||
for testcase in test*.vim; do
|
||||
vim -N -u NONE -S $testcase -c 'quit!'
|
||||
done
|
||||
|
||||
# Verify the results.
|
||||
count_ok=0
|
||||
count_fail=0
|
||||
|
||||
for expected in *.expected; do
|
||||
name=${expected%.*}
|
||||
actual=$name.actual
|
||||
|
||||
if diff $expected $actual; then
|
||||
count_ok=$((count_ok + 1))
|
||||
echo "$name ok"
|
||||
else
|
||||
count_fail=$((count_fail + 1))
|
||||
echo "$name failed"
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean up.
|
||||
git reset HEAD fixture.txt > /dev/null
|
||||
git checkout fixture.txt
|
||||
# rm -f *.actual
|
||||
|
||||
# Print results.
|
||||
echo
|
||||
echo "$((count_ok + count_fail)) tests"
|
||||
echo "$count_ok ok"
|
||||
echo "$count_fail failed"
|
||||
|
||||
Reference in New Issue
Block a user