aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
Commit message (Collapse)AuthorAge
* don't allow f-k-r to run if stdin/stdout not a ttyGravatar Kurtis Rader2016-06-26
| | | | | | | | 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.
* 'jobs.status' change missing from last commit.Gravatar Aaron Gyes2016-06-18
|
* bg had also had wrong exit code for some errorsGravatar Aaron Gyes2016-06-18
| | | | | Stop printing usage information when error isn't a usage problem. Add simple test for bg and fg
* remove unset vars from the environmentGravatar Kurtis Rader2016-06-15
| | | | | | | Remove vars from the environment that are no longer set. Simplify the code by removing an unnecessary loop. Add some tests. Fixes #3124
* Don't allow specifying an fd with a caret redirectionGravatar ridiculousfish2016-06-12
| | | | | | | | For example, an argument 12345^ is a real argument, not a redirection There's no reason to use ^ here instead of >, and it's annoying to git users. Fixes #1873
* don't print header for each jobGravatar Corey Ford2016-06-08
|
* simplify, and fix, setting the current localeGravatar Kurtis Rader2016-06-05
| | | | | | | | | | Fix test setup bogosities. Specifically, they weren't hermetic with respect to locale env vars. Rewrite the handling of locale vars to simplify the code and make it more like the pattern most programs employ. Fixes #3110
* mention nullglob exceptions in failglob error msgGravatar Beni Cherniavsky-Paskin2016-06-02
|
* Make string match -rnv workGravatar Fabian Homborg2016-05-31
| | | | Fixes #3098.
* tty driver ignore lnext (\cV) and werase (\cW)Gravatar Kurtis Rader2016-05-25
| | | | | | | | | | Configure the tty driver to ignore the lnext (\cV) and werase (\cW) characters so they can be bound to fish functions. Correct the `fish_key_bindings` program to initialize the tty in the same manner as the `fish` program. Fixes #3064
* Bring abbr test in line with new behaviorGravatar Fabian Homborg2016-05-23
| | | | | | Previously, `--erase` would not accept any options and wouldn't read "--" as option-separator. Now it does like every other "command", and it could conceivably gain e.g. a "--prefix" option.
* Don't mangle arguments in abbrGravatar Fabian Homborg2016-05-23
| | | | | | | This now (rightly) throws an error if there's a space in the key (because we can't store it). Fixes #2997.
* make debug() output more usefulGravatar Kurtis Rader2016-05-17
| | | | | | | | | | This change does several things. First, and most important, it allows dumping the "n" most recent stack frames on each debug() call. Second, it demangles the C++ symbols. Third, it prepends each debug() message with the debug level. Unrelated to the above I've replaced all `assert(!is_forked_child());` statements with `ASSERT_IS_NOT_FORKED_CHILD()` for consistency.
* add `function --shadow-builtin` flagGravatar Kurtis Rader2016-05-14
| | | | | | | | | | | | | | It's currently too easy for someone to bork their shell by doing something like `function test; return 0; end`. That's obviously a silly, contrived, example but the point is that novice users who learn about functions are prone to do something like that without realizing it will bork the shell. Even expert users who know about the `test` builtin might forget that, say, `pwd` is a builtin. This change adds a `--shadow-builtin` flag that must be specified to indicate you know what you're doing. Fixes #3000
* add floating point output to `math` commandGravatar Kurtis Rader2016-05-03
| | | | | | | | | | | This makes it easy for the user to request floating point output with the desired number of digits after the decimal point (not to be confused with significant digits). Note that this is just a thin wrapper so someone can say `math -s3 10 / 3` rather than `math "scale=3; 10 /3"`. Resolves #1643
* fix bind unit testsGravatar Kurtis Rader2016-04-28
| | | | | | In my rush to get the fix for the wrong default Vi mode escape delay merged (commit 3e24ae80b3739ded7d4066349fc87d13f2b70727) I neglected to update the unit test. This change corrects that oversight.
* provide a realpath implementationGravatar Kurtis Rader2016-04-28
| | | | | | | Not all distros have a `realpath` command. Provide a function that uses the real command if available else use the fish builtin. Fixes #2932
* Tests: Add fish_mode_prompt to except_promptGravatar Fabian Homborg2016-04-26
| | | | | Without this, the interactive tests fail when they receive a mode_prompt in vi-mode.
* retry flakey tests on failureGravatar Kurtis Rader2016-04-11
| | | | Fixes #2926
* enhance fish_indent to normalize keywordsGravatar Kurtis Rader2016-04-10
| | | | | | | | | | | Fish keywords can be quoted and split across lines. Prior to this change `fish_indent` would retain such odd, obfuscated, formatting. This change results in all keywords being converted to their canonical form. This required fixing a bug: the keyword member of parse_node_t wasn't being populated. This hadn't been noticed prior to now because it wasn't used. Fixes #2921
* fix handling of line continuation in keywordsGravatar Jak Wings2016-04-08
| | | | | | | This behavior is more consistent with line continuation in strings other than keywords. Fixes #2897
* Migrate PATH-completion logic from complete.cpp to expand.cppGravatar ridiculousfish2016-04-07
| | | | | | | | | | | | | | | | Prior to this fix, when completing a command that doesn't have a /, we would prepend each component of PATH and then expand the whole thing. So any special characters in the PATH would be interpreted when performing tab completion. With this fix, we pull the PATH resolution out of complete.cpp and migrate it to expand.cpp. This unifies nicely with the CDPATH resolution already in that file. This requires introducing a new expand flag EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD (which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to resolve paths against PATH instead of the working directory. Fixes #952
* Implement an --invert/-v for string match, like grep -v.Gravatar Aaron Gyes2016-04-08
| | | | Only lines that do not match the pattern are shown.
* fix setting of $argv for `source` w/no argsGravatar Kurtis Rader2016-04-06
| | | | Fixes #139
* change how redirections are formattedGravatar Kurtis Rader2016-04-05
| | | | | | | | Modify `fish_indent` to emit redirections without a space before the target of the redirection; e.g., "2>&1" rather than "2>& 1" as the former is clearer to humans. Fixes #2899
* fix handling of non-ASCII chars in C localeGravatar Kurtis Rader2016-03-20
| | | | | | | | | | | | The relevant standards allow the mbtowc/mbrtowc functions to reject non-ASCII characters (i.e., chars with the high bit set) when the locale is C or POSIX. The BSD libraries (e.g., on OS X) don't do this but the GNU libraries (e.g., on Linux) do. Like most programs we need the C/POSIX locales to allow arbitrary bytes. So explicitly check if we're in a single-byte locale (which would also include ISO-8859 variants) and simply pass-thru the chars without encoding or decoding. Fixes #2802.
* make testing on local servers hermeticGravatar Kurtis Rader2016-02-25
| | | | | | | | | | | | | | | | | | 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
* make fish compatible with pcre2 10.21Gravatar Michael Steed2016-02-21
| | | | | | | | | | | | | pcre2_substitute() now sets the output buffer length to PCRE2_UNSET (~0) if the output buffer is determined to be too small. This change keeps track of the buffer size separately where pcre2 can't touch it. A better fix would be to let pcre2 tell fish what size buffer it needs. This can be done with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, but this requires pcre2 10.21 or later (released January 12), which may be too new to introduce as a dependency at this point. Fixes #2743
* fix flakey testGravatar Kurtis Rader2016-02-16
| | | | | | I've run this more than twenty times through Travis CI (by adding/removing a comment line). Without this tweak the longest sequence seems to be around six successful runs.
* Reinstate failglob behaviour for most commandsGravatar Andreas Nordal2016-02-15
| | | | | | | | | | | | | | | | | Expand globs to zero arguments (nullglob) only for set, for and count. The warning about failing globs, and setting the accompanying $status, now happens regardless of mode, interactive or not. It is assumed that the above commands are the common cases where nullglob behaviour is desirable. More importantly, doing this with `set` is a real feature enabler, since the resulting empty array can be passed on to any command. The previous behaviour was actually all nullglob (since commit cab115c8b9933ae7db9412c66d452c0ccb2d7152), but this was undocumented; the failglob warning was still printed in interactive mode, and the documentation was bragging about failglob behaviour.
* Update bind.expect for travis-CIGravatar ridiculousfish2016-02-04
| | | | | | Travis-CI runs with clang ASAN enabled, which makes fish slow enough that certain timing tests fail. Sleep a little so that fish can catch up.
* Merge change for lengthened and configurable escape key timeoutGravatar ridiculousfish2016-02-04
|\
| * change default escape timeoutGravatar Kurtis Rader2016-02-04
| | | | | | | | | | | | | | | | This changes the default escape timeout for the default keybindings (emacs mode) to 300ms and the default for vi keybindings to 10ms. I couldn't resist fixing a few nits in the fish_vi_key_bindings.fish file since I was touching it to set the escape timeout.
| * make travis-ci happy againGravatar Kurtis Rader2016-02-04
| |
* | Fix t-binding test for new escape behaviorGravatar ridiculousfish2016-02-02
| |
* | Merge branch 'fix-jump' of git://github.com/cpick/fish-shell into cpick-fix-jumpGravatar ridiculousfish2016-02-02
|\ \
| | * make bind unit tests more robust on travis-ciGravatar Kurtis Rader2016-01-17
| | | | | | | | | | | | | | | | | | | | | 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.
| | * allow configuring the escape delay timeoutGravatar Kurtis Rader2016-01-17
| | | | | | | | | | | | | | | | | | | | | | | | Introduce a "fish_escape_delay_ms" variable to allow the user to configure the delay used when seeing a bare escape before assuming no other characters will be received that might match a bound character sequence. This is primarily useful for vi mode so that a bare escape character (i.e., keystroke) can switch to vi "insert" to "normal" mode in a timely fashion.
* | | abbr: Ensure we don't split on "=" if the given separator is " "Gravatar Fabian Homborg2016-01-14
| | | | | | | | | | | | | | | | | | | | | This fails on e.g. an abbr that uses `env a=b`, like the included test demonstrates. Unfortunately it decreases the speed again (2s vs 2.2s vs 4s original), but correctness is more important.
* | | abbr tests: Don't expect quoted "--*"Gravatar Fabian Homborg2016-01-14
| | | | | | | | | | | | | | | | | | This doesn't seem necessary given we already prefix it with "--". If this is backed out, the part about using string escape also needs to be removed.
* | | Stop unescaping strings with `commandline -b`Gravatar Kevin Ballard2016-01-10
| | | | | | | | | | | | | | | | | | | | | | | | The fix for #2075 inadvertently started unescaping the strings emitted from `commandline -b`. Only strings emitted with the `-o` flag are supposed to be unescaped. Fixes #2210.
| | * fix unit tests related to the escape timeoutGravatar Kurtis Rader2015-12-23
| |/ |/|
* | Allow and/or statements to attach to the if/while headerGravatar ridiculousfish2015-12-19
| | | | | | | | | | | | | | | | | | | | For example: if false; or true; echo hello; end will output 'hello' now. Fixes #1428
* | Write tests for new if/and/or behavior (#1428)Gravatar ridiculousfish2015-12-19
| | | | | | | | They fail for now.
* | psub: add -s, --suffixGravatar Eugene Sharygin2015-11-14
| |
* | tests: try longer timeout in case setting fish_key_bindings is taking too longGravatar David Adam2015-10-30
| |
* | Make 'set -ql' search up to function scopeGravatar ridiculousfish2015-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously 'set -ql' would only look for variables in the immediate local scope. This was not very useful. It's also arguably surprising, since a 'set -l' in a function, followed by a 'set -ql' in a child block, would fail. There was also no way to check for a function-scoped variable, since omitting the scope would also pull in global variables. We could revisit this and introduce an explicit function scope. Fixes #2502
* | tests/bind.expect: re-enable but at human typing speed onlyGravatar David Adam2015-10-18
| | | | | | | | | | | | | | The interactive bind tests work if the keys are treated like there is a human pressing them. This reverts commit 0006d23df82fd10c37acecc5a0fd578afb3be437.
* | Disable the bind test for nowGravatar Fabian Homborg2015-10-18
| | | | | | | | | | | | | | | | | | | | This isn't pretty, but it fails for, as far as I can see, no _real_ reason. It doesn't seem to be possible to trigger the failure in real usage, no matter how fast you press the ESC key followed by something else. So now this is known and constant travis emails don't help it in any way.
* | tests/string.in: add tests for string builtinGravatar David Adam2015-10-09
| |