mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Use clearer file extensions for test files.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
/doc/tags
|
||||
/misc
|
||||
/test/*.out
|
||||
/test/*.actual
|
||||
|
||||
@@ -19,9 +19,9 @@ call Setup()
|
||||
```
|
||||
|
||||
- Run the tests.
|
||||
- Inspect output from the new test. If good, copy it to `foo.ok`.
|
||||
- Inspect output (in `foo.actual`) from the new test. If good, copy it to `foo.expected`.
|
||||
- Run the tests to ensure new test's output is verified.
|
||||
- `rm *.out` and commit changes.
|
||||
- Commit changes.
|
||||
|
||||
### Limitations
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ function! Setup()
|
||||
endfunction
|
||||
|
||||
function! DumpSigns(filename)
|
||||
execute 'redir! > ' a:filename.'.out'
|
||||
execute 'redir! > ' a:filename.'.actual'
|
||||
silent execute 'sign place'
|
||||
redir END
|
||||
endfunction
|
||||
|
||||
function! DumpGitDiff(filename)
|
||||
call system('git diff --staged fixture.txt > '.a:filename.'.out')
|
||||
call system('git diff --staged fixture.txt > '.a:filename.'.actual')
|
||||
endfunction
|
||||
|
||||
10
test/test.sh
10
test/test.sh
@@ -3,7 +3,8 @@
|
||||
# TODO: exit with non-zero status code when tests fail.
|
||||
|
||||
|
||||
rm -f *.out
|
||||
# Clean up.
|
||||
rm -f *.actual
|
||||
|
||||
# Execute the tests.
|
||||
for testcase in test*.vim; do
|
||||
@@ -14,9 +15,9 @@ done
|
||||
count_ok=0
|
||||
count_fail=0
|
||||
|
||||
for expected in *.ok; do
|
||||
for expected in *.expected; do
|
||||
name=${expected%.*}
|
||||
actual=$name.out
|
||||
actual=$name.actual
|
||||
|
||||
if diff $expected $actual; then
|
||||
count_ok=$((count_ok + 1))
|
||||
@@ -27,9 +28,12 @@ for expected in *.ok; do
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user