Unit tests for hyperjump functions#14
Open
daveFNbuck wants to merge 1 commit into
Open
Conversation
Hyperjump is supposed to support both bash and zsh, but it's easy for people who use one to break support for the other. By adding some tests, we can more easily ensure that support for both shells is maintained. Assertions for autocompletion are skipped in zsh because they don't run properly. I guess the bashcompinit is doing some magic there. The tests still run to catch syntax errors, as it seems to work as long as we don't have any of those. This also adds a .travis.yml so the tests can be run automatically on Travis for both shells and both osx and linux. You can run the tests by installing shunit2 and running bash tests.sh or zsh -y tests.sh. Note that this allows the db location to be manipulated via setting the HYPERJUMP_DB shell parameter. This is necessary to run tests locally without overwriting the user's db.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hyperjump is supposed to support both bash and zsh, but it's easy for
people who use one to break support for the other. By adding some tests,
we can more easily ensure that support for both shells is maintained.
Assertions for autocompletion are skipped in zsh because they don't run
properly. I guess the bashcompinit is doing some magic there. The tests
still run to catch syntax errors, as it seems to work as long as we
don't have any of those.
This also adds a .travis.yml so the tests can be run automatically on
Travis for both shells and both osx and linux.
You can run the tests by installing shunit2 and running bash tests.sh
or zsh -y tests.sh.
Note that this allows the db location to be manipulated via setting the
HYPERJUMP_DB shell parameter. This is necessary to run tests locally
without overwriting the user's db.
I set up hyperjump for my fork. https://travis-ci.org/daveFNbuck/hyperjump/builds/407438695 is the build corresponding to this pull requests. It shows 11 failures for zsh on both osx and linux, and no failures for bash. There are failures corresponding to a syntax error in list and to -p causing read to fail in jj, jf, and jr. These failures are fixed in #12 and #13. I built a branch with both of those at https://travis-ci.org/daveFNbuck/hyperjump/builds/407438799, and all the tests passed.