diff --git a/.gitignore b/.gitignore index ea70350..0bec46f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /doc/tags /misc -/test/*.out +/test/*.actual diff --git a/test/README.markdown b/test/README.markdown index d9d6ffd..8938394 100644 --- a/test/README.markdown +++ b/test/README.markdown @@ -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 diff --git a/test/addLines.ok b/test/addLines.expected similarity index 100% rename from test/addLines.ok rename to test/addLines.expected diff --git a/test/helper.vim b/test/helper.vim index 56929e2..ec23e4d 100644 --- a/test/helper.vim +++ b/test/helper.vim @@ -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 diff --git a/test/hunkStageGitDiff.ok b/test/hunkStageGitDiff.expected similarity index 100% rename from test/hunkStageGitDiff.ok rename to test/hunkStageGitDiff.expected diff --git a/test/hunkStageSigns.ok b/test/hunkStageSigns.expected similarity index 100% rename from test/hunkStageSigns.ok rename to test/hunkStageSigns.expected diff --git a/test/modifyLines.ok b/test/modifyLines.expected similarity index 100% rename from test/modifyLines.ok rename to test/modifyLines.expected diff --git a/test/noModifications.ok b/test/noModifications.expected similarity index 100% rename from test/noModifications.ok rename to test/noModifications.expected diff --git a/test/orphanedSigns.ok b/test/orphanedSigns.expected similarity index 100% rename from test/orphanedSigns.ok rename to test/orphanedSigns.expected diff --git a/test/removeFirstLines.ok b/test/removeFirstLines.expected similarity index 100% rename from test/removeFirstLines.ok rename to test/removeFirstLines.expected diff --git a/test/removeLines.ok b/test/removeLines.expected similarity index 100% rename from test/removeLines.ok rename to test/removeLines.expected diff --git a/test/test.sh b/test/test.sh index 9496b00..6fbb04a 100755 --- a/test/test.sh +++ b/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"