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
|
/doc/tags
|
||||||
/misc
|
/misc
|
||||||
/test/*.out
|
/test/*.actual
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ call Setup()
|
|||||||
```
|
```
|
||||||
|
|
||||||
- Run the tests.
|
- 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.
|
- Run the tests to ensure new test's output is verified.
|
||||||
- `rm *.out` and commit changes.
|
- Commit changes.
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ function! Setup()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DumpSigns(filename)
|
function! DumpSigns(filename)
|
||||||
execute 'redir! > ' a:filename.'.out'
|
execute 'redir! > ' a:filename.'.actual'
|
||||||
silent execute 'sign place'
|
silent execute 'sign place'
|
||||||
redir END
|
redir END
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DumpGitDiff(filename)
|
function! DumpGitDiff(filename)
|
||||||
call system('git diff --staged fixture.txt > '.a:filename.'.out')
|
call system('git diff --staged fixture.txt > '.a:filename.'.actual')
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
10
test/test.sh
10
test/test.sh
@@ -3,7 +3,8 @@
|
|||||||
# TODO: exit with non-zero status code when tests fail.
|
# TODO: exit with non-zero status code when tests fail.
|
||||||
|
|
||||||
|
|
||||||
rm -f *.out
|
# Clean up.
|
||||||
|
rm -f *.actual
|
||||||
|
|
||||||
# Execute the tests.
|
# Execute the tests.
|
||||||
for testcase in test*.vim; do
|
for testcase in test*.vim; do
|
||||||
@@ -14,9 +15,9 @@ done
|
|||||||
count_ok=0
|
count_ok=0
|
||||||
count_fail=0
|
count_fail=0
|
||||||
|
|
||||||
for expected in *.ok; do
|
for expected in *.expected; do
|
||||||
name=${expected%.*}
|
name=${expected%.*}
|
||||||
actual=$name.out
|
actual=$name.actual
|
||||||
|
|
||||||
if diff $expected $actual; then
|
if diff $expected $actual; then
|
||||||
count_ok=$((count_ok + 1))
|
count_ok=$((count_ok + 1))
|
||||||
@@ -27,9 +28,12 @@ for expected in *.ok; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Clean up.
|
||||||
git reset HEAD fixture.txt > /dev/null
|
git reset HEAD fixture.txt > /dev/null
|
||||||
git checkout fixture.txt
|
git checkout fixture.txt
|
||||||
|
rm -f *.actual
|
||||||
|
|
||||||
|
# Print results.
|
||||||
echo
|
echo
|
||||||
echo "$((count_ok + count_fail)) tests"
|
echo "$((count_ok + count_fail)) tests"
|
||||||
echo "$count_ok ok"
|
echo "$count_ok ok"
|
||||||
|
|||||||
Reference in New Issue
Block a user