Skip to content

Unit tests for hyperjump functions#14

Open
daveFNbuck wants to merge 1 commit into
x0054:masterfrom
daveFNbuck:unittest
Open

Unit tests for hyperjump functions#14
daveFNbuck wants to merge 1 commit into
x0054:masterfrom
daveFNbuck:unittest

Conversation

@daveFNbuck

Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant