Commit Graph

602 Commits

Author SHA1 Message Date
Aaron Gyes
902c6ec4a3 Check for {g,}date existance before trying --version 2019-09-21 18:42:55 -07:00
Aaron Gyes
7804a5e477 Revert "Correctly detect the presence of gdate"
This reverts commit 4b181df254.

It will result in systems without a GNU date having a literal "N"
in the output.
2019-09-21 18:40:32 -07:00
ridiculousfish
5f64972908 Do not try the same (command, wraps) pair more than once when completing
This prevents runaway wrap chains. Fixes #5638.
2019-09-21 14:09:38 -07:00
ridiculousfish
4b181df254 Correctly detect the presence of gdate
Fixes some test spew
2019-09-21 12:12:08 -07:00
Aaron Gyes
102ddd2b79 tests/checks/complete.fish: don't check unsorted lines 2019-09-19 15:44:15 -07:00
Aaron Gyes
6459682c93 Work around indeterminant ordering for complete test
Not a cool fix but it should work
2019-09-19 15:35:25 -07:00
Aaron Gyes
9486af8805 tests: fix date --version printing junk, update interactive.fish 2019-09-19 15:06:51 -07:00
Aaron Gyes
53a3533285 Add tests for complete (no args) output
Hopefully this should catch things if the output gets broken again.
2019-09-19 15:01:09 -07:00
Aaron Gyes
5c06e68115 tests: add a lame gdate-based ms-precision timer if installed
I got tired of seeing ' ... ok (0 sec)' so now with GNU date/gdate
installed there is millisecond output shown. One can get rough
nanoseconds from gdate.
2019-09-19 14:26:53 -07:00
Aaron Gyes
61f0756fe6 builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
ridiculousfish
533ee65963 Allow binding nul (zero byte)
This sequence can be generatd by control-spacebar. Allow it to be bound
properly.

To do this we must be sure that we never round-trip the key sequence
through a C string.
2019-09-14 16:37:57 -07:00
ridiculousfish
7ea3255eef Correct the exit expect test
There was an errant space which is not matched; this seems to cause problems
only on one machine for mysterious reasons.
2019-09-14 12:46:57 -07:00
David Adam
77ef2ef6c3 jobs: return success when a job is found via --last
Closes #6104.
2019-09-14 13:01:36 -05:00
ridiculousfish
fa6bac1283 Correctly implement and --help and or --help 2019-09-08 10:42:24 -07:00
David Adam
225b1204d6 read: add --list as synonym for --array
Work on #5846.
2019-08-22 21:24:17 +08:00
Aaron Gyes
47798510bd tests, CHANGELOG: regex-easyesc
Oops, missed these the first time around.
2019-08-13 22:56:31 -07:00
Fabian Homborg
6500765256 Allow switch with something that expands to nothing
Meaning empty variables, command substitutions that don't print
anything.

A switch without an argument

```fish
switch
   case ...
end
```

is still a syntax error, and more than one argument is still a runtime
error.

The none-argument matches either an empty-string `case ''` or a
catch-all `case '*'`.

Fixes #5677.

Fixes #4943.
2019-07-31 14:08:28 +02:00
Fabian Homborg
57ffd18787 tests/checks/set: Make a temporary XDG_CONFIG_HOME
This test uses universal variables, and so it can fail when run
multiple times.

It might be a good idea to do this in general, but for now let's just
try it here.
2019-07-31 13:52:36 +02:00
ridiculousfish
554ee240b3 Correct handling of explicitly separated output when all elements are empty
Previously when propagating explicitly separated output, we would early-out
if the buffer was empty, where empty meant contains no characters. However
it may contain one or more empty strings, in which case we should propagate
those strings.

Remove this footgun "empty" function and handle this properly.

Fixes #5987
2019-07-21 14:00:27 -07:00
ridiculousfish
e8c6de8055 Correctly export empty universal variables
Fixes #5992
2019-07-21 12:45:29 -07:00
ridiculousfish
01dff25f62 Remove test3
This is now handled by littlecheck
2019-07-21 12:18:28 -07:00
ridiculousfish
07d1607e58 Port tests/test3.in to littlecheck
This just tests 'set'
2019-07-21 12:18:28 -07:00
ridiculousfish
cdcea0f00d Port setenv tests to littlecheck 2019-07-09 10:02:50 -07:00
Fabian Homborg
65eb4cd9d3 eval tests: Fix path
I tested this manually (`littlecheck.py -s fish=fish tests/checks/eval.fish`) from the base directory, which means I got
"tests/checks/eval", while the real test gets "checks/eval".

I then reran `make test_fishscript`, but that didn't pull in the
updated test - we should really handle that better.
2019-07-03 15:14:49 +02:00
Fabian Homborg
f1fa8d5f5b Port complete tests to littlecheck 2019-07-03 13:02:15 +02:00
Fabian Homborg
87b05d3111 Port eval tests to littlecheck 2019-07-03 12:54:42 +02:00
Fabian Homborg
4ae18951ee Add NetBSD's error to the bad-option test
I'm kinda close to just checking `.*fish: .*option.*Z.*`
2019-07-02 23:48:25 +02:00
Fabian Homborg
d775c584a5 Port realpath tests to littlecheck
I'm gonna add more tests to this and I don't want to touch the old stuff.

Notice that this needs to have the output of the complete_directories
test adjusted because this one now runs later.

That's something we should take into account in future.
2019-07-02 23:05:50 +02:00
Fabian Homborg
7d3bec1297 test.fish: Notice littlecheck failures
This failed to propagate the exit status. Sorry!
2019-07-02 22:50:16 +02:00
Fabian Homborg
4c022a708f tests: Simplify directory-redirect test
This doesn't need the indirection, since it was only an invocation
test because we couldn't express it in the old runner.
2019-06-28 20:48:11 +02:00
ridiculousfish
262fe65121 Correctly mark a node when erasing an exported variable
Fixes #5965
2019-06-28 11:22:49 -07:00
ridiculousfish
3c800e0608 Make history tests more robust
history now often writes to the history file asynchronously, but the history
test expects to find the text in the file immediately after running the
command. Hack a bit in history to make this test more reliable.
2019-06-28 11:16:27 -07:00
Fabian Homborg
22d2620716 Rerun all interactive tests once
They are *all* flakey enough that we regularly see them fail, at least
on Travis.
2019-06-26 21:26:20 +02:00
Fabian Homborg
4d035cbd10 Port bind tests to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
fdf0a661cf Port andandoror test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
8e11f802b4 Port alias test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
9462aacc5c Port abbr test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
21805759a3 Port math test to littlecheck
This shows one bit where not trimming whitespace would make sense.
2019-06-26 21:19:40 +02:00
Fabian Homborg
2f19ec1c34 Port count test to littlecheck 2019-06-26 21:19:40 +02:00
ridiculousfish
b672e1891e Port signal tests to littlecheck 2019-06-26 11:07:46 -07:00
Fabian Homborg
cdbd0891f7 Remove invocation tests
These are now all performed by littlecheck, so there's no need for the
entire target anymore.
2019-06-25 22:31:45 +02:00
Fabian Homborg
a33c2f0bce Port config tests to littlecheck
This required a bit of thinking.

What we do is we have one test that fakes $HOME, and then we do the
various config tests there.

The fake config we have is reused and we exercise all of the same codepaths.
2019-06-25 22:31:06 +02:00
Fabian Homborg
10949648e7 Port qmark1 test to littlecheck
This one just needs a random home.
2019-06-25 22:31:06 +02:00
Fabian Homborg
5c7b7fd609 Readd bad-switch and directory-redirection tests
Made possible by the power of regex.
2019-06-25 22:30:58 +02:00
Fabian Homborg
b9c1f4b122 Remove ported tests 2019-06-25 21:00:13 +02:00
Fabian Homborg
21667850b3 tests/test.fish: Normalize littlecheck output
This prints a green "ok" with the duration, just like the rest of the
tests.

Note that this clashes a bit with
https://github.com/ridiculousfish/littlecheck/pull/3.

(also don't check for python again and again and again)
2019-06-25 20:57:37 +02:00
Fabian Homborg
9d5620c170 Port most of the invocation tests to littlecheck
This is a bit weird sometimes, e.g. to test the return status (that
fish actually *returns $status*), we use a #RUN line with %fish
invoking %fish, so we can use the substitution.

Still much nicer.

The missing scripts are those that rely on config.
2019-06-25 20:56:29 +02:00
Fabian Homborg
93d9fa4551 tests/test.fish: Run littlecheck with any python
Some operating systems don't have a "python" symlink, so we just run
it with the first python we find.
2019-06-25 19:25:36 +02:00
Fabian Homborg
1bba77e485 Port string tests to littlecheck
`wc -l tests/string.*`
  329 tests/string.err
  422 tests/string.in
  520 tests/string.out
 1271 total

`wc -l tests/checks/string.fish`
 555 tests/checks/string.fish

and it looks nicer. 'nuff said.
2019-06-25 17:26:36 +02:00
Fabian Homborg
77d8487078 string: Also stop printing documentation
Especially as, in this case, the documentation is quite massive.

Caught by porting string's test to littlecheck.

See #3404 - this was already supposed to be included.
2019-06-25 17:26:30 +02:00