Commit Graph

10 Commits

Author SHA1 Message Date
Kurtis Rader
d7bc20c933 don't allow f-k-r to run if stdin/stdout not a tty
Another developer noticed that redirecting stdin of `fish_key_reader`
results in weird behavior.  Which is not at all surprising. So add checks
to ensure stdin and stdout are attached to a tty.

Add some rudimentary unit tests for this program.
2016-06-26 21:51:00 -07:00
Fabian Homborg
7ebafa53f6 Tests: Add fish_mode_prompt to except_prompt
Without this, the interactive tests fail when they receive a mode_prompt
in vi-mode.
2016-04-26 15:21:15 +02:00
Kurtis Rader
8b67a1b26f make testing on local servers hermetic
I noticed while fixing issue #2702 that the fish program being tested
was sourcing config.fish files outside of the current build. This also
happens when Travis CI runs the tests but isn't an issue there because
of how Travis is configured to execute the tests.

I also noticed that running `make test` was polluting my personal fish
history; which will become a bigger problem if and when the fishd universal
var file is moved from $XDG_CONFIG_HOME to $XDG_DATA_HOME.

This change makes it possible for an individual to run the tests on
their local machine secure in the knowledge that only the config.fish and
related files from their git repository will be used and doing so won't
pollute their personal fish history.

Resolves #469
2016-02-25 17:16:36 -08:00
Kurtis Rader
11785c2bf4 make bind unit tests more robust on travis-ci
My previous commit failed in the travis-ci environment despite passing on my
local computer. This appears to be due to expect timing out looking for the
expected input. See if increasing the expect timeout slightly fixes the
problem.
2016-01-17 19:14:54 -08:00
David Adam
d3bcee9e2e tests: try longer timeout in case setting fish_key_bindings is taking too long 2015-10-30 13:31:02 +08:00
Kevin Ballard
c4a453fb22 Try to fix the Travis test failures
It seems expect prioritizes the first pattern in the list, instead of
the pattern that matches earliest in the buffer. That seems pretty
stupid, but let's try moving the prompt pattern to the end and see if
that fixes the Travis failures.
2014-09-23 23:20:02 -07:00
Kevin Ballard
c64f38f0bf Add extra logging for interactive test failures 2014-09-21 19:42:39 -07:00
Kevin Ballard
51c2005ea2 Tweak interactive debug output 2014-09-19 16:22:37 -07:00
Kevin Ballard
0a32d96b27 Reset fish_bind_mode when changing fish_key_bindings
Also avoid resetting bindings if fish_key_bindings is "modified" without
actually changing.

Fixes #1638.
2014-09-18 15:46:17 -07:00
Kevin Ballard
190712d4b0 Add a test harness for interactive behavior
Add a test harness that uses `expect` to drive Fish to test interactive
behavior.

Include some tests for `read`.
2014-09-07 23:56:59 -07:00