Use clearer file extensions for test files.

This commit is contained in:
Andy Stewart
2014-11-13 15:27:52 +01:00
parent 1f2bb48be5
commit e5add67b03
12 changed files with 12 additions and 8 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
/doc/tags
/misc
/test/*.out
/test/*.actual

View File

@@ -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

View File

@@ -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

View File

@@ -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"