Commit Graph

177 Commits

Author SHA1 Message Date
Fabian Homborg
b7b09add95 Revert complete_directories change
Turns out my test dir wasn't as clean as it should have been.
2020-03-17 21:45:49 +01:00
Fabian Homborg
4d052da922 Remove classic ".in" test machinery
We have now entirely switched the script tests to littlecheck.

Note: This adjusts the complete_directories test, because it removes a
directory that was created before by a .in test. There's no real
change in behavior.

This does require the test directory be cleaned, or the tests will fail.

test_util gets to stay for a while longer, because it sets up the
testing env (locale and such).
2020-03-17 21:34:36 +01:00
Fabian Homborg
957526a283 Port "test9" to littlecheck
Just add it to basic.fish

This was the last .in test.
2020-03-17 21:19:41 +01:00
Fabian Homborg
fbf9d4e6f8 Port "test7" to littlecheck
Soon.
2020-03-17 20:57:45 +01:00
Fabian Homborg
e78db2bcb8 Port "test1" to littlecheck
This, together with the other testX, really just tests some basic
syntax. So let's just call it "basic".

Note that this file uses escaped newlines on purpose, so restyling it
would currently break it. I'm not sure what the best thing to do here is.
2020-03-17 20:48:40 +01:00
Fabian Homborg
2731bcec70 Port umask tests to littlecheck
This saves us from adding all these explanatory echoes.
2020-03-16 21:21:10 +01:00
Fabian Homborg
52b5afe2f8 Port expansion test to littlecheck
This one really is a lot easier to follow
2020-03-16 21:21:10 +01:00
Fabian Homborg
7e594e692c Port fish_indent tests to littlecheck 2020-03-16 21:21:10 +01:00
Fabian Homborg
aa629c5aca Reformat fish scripts with escaped newline changes to fish_indent 2020-03-15 21:01:11 +01:00
Fabian Homborg
7891973c9c fish_indent: Add check
This isn't quite the old-style test, but it checks some of the line
continuation stuff.

Note that littlecheck ignores leading whitespace, so testing the
actual indentation requires some more effort.
2020-03-15 21:01:11 +01:00
Fabian Homborg
9f984ee897 Reindent final check
This included some things in its string, so `fish_indent` would stomp
over it.
2020-03-09 19:46:43 +01:00
Fabian Homborg
9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00
ridiculousfish
b0c2eda3b4 Revert "Revert "Enable job-control in pipeline-pgroup test""
This reverts commit c9f450a93e.

Puts back job-control in this test.
2020-03-02 14:01:59 -08:00
ridiculousfish
1c5b1ff5c2 Correct a race condition in pipeline-pgroup test
This test launches two background processes and is sensitive to
interleaving of output. Fix it so that newlines are not output by
the background process.

Hopefully this fixes the flakiness of this test.
2020-03-02 14:00:57 -08:00
ridiculousfish
c9f450a93e Revert "Enable job-control in pipeline-pgroup test"
This reverts commit cdbf0a9d20.

Reverting until the tests pass consistently.
2020-03-01 23:35:53 -08:00
ridiculousfish
cdbf0a9d20 Enable job-control in pipeline-pgroup test
Otherwise it's not testing anything interesting
2020-02-29 18:00:19 -08:00
ridiculousfish
c5fa580948 Rationalize background-in-background procs
If a background process runs a fish function which launches another
background process, ensure that these background procs get different
pgroups. Add a test for it.
2020-02-29 15:07:09 -08:00
Johannes Altmanninger
706c1a838e Fix tests for 91fcb8c42c 2020-02-29 10:48:19 +01:00
Johannes Altmanninger
91fcb8c42c Revert "read: discard IFS delimiters before the last token"
See #6650.

This reverts commit 1410f938aa.
2020-02-29 09:53:53 +01:00
Fabian Homborg
22c0054c1e Add check to test all fish files with -n
This executes `fish --no-execute` a whole bunch of times in order to
find syntax errors in our fish scripts.

tests/ is exempt because it contains syntax errors on purpose.

This is a great idea in principle, but it takes ~4s on my system.
2020-02-26 19:15:50 +01:00
Fabian Homborg
70b8fb22e1 test: Reject nan/inf instead of crashing
I really don't want to get into the business of explaining to people
how nan != nan.

Fixes #6655.
2020-02-26 16:43:12 +01:00
Johannes Altmanninger
ccd3ac4f18 fixup test
only works interactively
2020-02-24 00:21:23 +01:00
Johannes Altmanninger
aa0e16b1a5 Skip variable assignments in status current command
Fixes #6635
2020-02-24 00:16:12 +01:00
Johannes Altmanninger
7ef7f93a90 List time as builtin, support time --help
`a=b time foo` will no longer call an external `time` command
(like it does in bash).

Fixes #6598
2020-02-23 23:42:57 +01:00
Fabian Homborg
5f9c33b50a Don't time --no-execute
This made some output for non-execution.

See #977.
2020-02-17 11:39:53 +01:00
Fabian Homborg
3f5c60e634 Silence some errors for fish --no-execute
It used to error out when a command wasn't known, even when it was a
function that would only be discovered via autoloading.

Now we just accept that a command doesn't exist when no-execute is
given - we're not gonna execute it anyway.

Also, in the same breath stop counting empty commands after expansion
and empty wildcard expansions as errors - these depend on runtime
values, so we can't verify them without executing.

Fixes #977.

(note that it still executes "time", but that's another commit)
2020-02-17 11:39:53 +01:00
Fabian Homborg
aba900a71f Reallow "2>>&1" as a redirection
Appending to an fd doesn't really make sense, but we allowed the
syntax previously and it was actually used.

It's not too harmful to allow it, so let's just do that again.

For the record: Zsh also allows it, bash doesn't.

Fixes #6614
2020-02-17 08:57:41 +01:00
Johannes Altmanninger
7517128b68 Update exports when an exported universal variable changes
Fixes #6612
2020-02-16 18:51:19 +01:00
Fabian Homborg
13b470af07 Readd ^&1 redirection
This was lost in 35671dd9f0.

Even tho we plan to drop caret redirection, while it's there it should
fully work.

Fixes #6591.
2020-02-14 20:28:46 +01:00
Fabian Homborg
0d2c11249e Ignore unreadable cwd error harder
Should fix the tests on macOS.
2020-02-14 20:09:07 +01:00
Fabian Homborg
f053cd27c6 Return glob ordering to pre-3.1 state
Glob ordering is used in a variety of places, including figuring out
conf.d and really needs to be stable.

Other ordering, like completions, is really just cosmetic and can
change if it makes for a nicer experience.

So we uncouple it by copying the wcsfilecmp from 3.0.2, which will
return the ordering to what it was in that release.

Fixes #6593
2020-02-14 19:06:19 +01:00
Fabian Homborg
7c879ed356 Let test for unreadable cwd work on macos
It has a different error. We don't care, we expect an error.
2020-02-14 18:34:07 +01:00
Fabian Homborg
ceba851d44 parser: Stop crashing when cwd isn't readable
Everything seems to be working, so instead of crashing just print an
error and return.

Fixes #6597
2020-02-14 17:57:07 +01:00
Fabian Homborg
6cccfa7cf4 tests/read: Make an error more useful
It would be nice to know what the length *is* if it's not the max.
2020-02-12 22:02:32 +01:00
Fabian Homborg
860394d1bd tests/pipestatus: Allow for command false to return 255
SOLAAAAAARIIIIIISSS!
2020-02-12 22:02:32 +01:00
Aaron Gyes
d556f04823 Revert "timer.cpp: use units like 'ms', etc. vs. "millis""
This reverts commit c01356ddd1.

Tests broken
2020-02-12 02:06:30 -08:00
Aaron Gyes
c01356ddd1 timer.cpp: use units like 'ms', etc. vs. "millis"
Change wording and omit '.00' decimal points in times
2020-02-12 01:53:48 -08:00
Johannes Altmanninger
be06f842a2 Allow to omit indices in index range expansions
Missing range limits in, say $PATH[..] default to the first/last
element, just like Python/Go/Rust slices.
2020-02-10 18:38:01 +01:00
ridiculousfish
6bf9ae9aeb Fix up --on-job-exit caller
The `function --on-job-exit caller` feature allows a command substitution
to observe when the parent job exits. This has never worked very well - in
particular it is based on job IDs, so a function that observes this will
run multiple times. Implement it properly.

Do this by having a not-recycled "internal job id".

This is only used by psub, but ensure it works properly none-the-less.
2020-02-08 16:23:25 -08:00
Fabian Homborg
f67a9f2ee7 Port another part of test1 to littlecheck
This time it's redirections
2020-02-08 18:21:05 +01:00
Fabian Homborg
5e6c9508e9 Port a part of test1 to littlecheck
Test1 is a grab bag of stuff, so we need to separate it.

This part is concerned with for-loops, so we move it to loops.fish
2020-02-08 17:49:02 +01:00
Fabian Homborg
ee8ca246f8 Port test8 to littlecheck
This one tests a bunch of separate stuff, so we put it into a few
different files.

The main, new one is "slices.fish", which tests various index expressions.
2020-02-08 15:55:10 +01:00
Fabian Homborg
22edf3213f Port "test4" to littlecheck
It has to do with scoping, so call it "scoping.fish".
2020-02-08 15:54:58 +01:00
Fabian Homborg
6daab9c41f Port while test to littlecheck
And we're gonna add more loop stuff, so port it to a file called "loop.fish"
2020-02-08 15:21:22 +01:00
Fabian Homborg
0ddbd8d318 Fix typo in bad options test
This had a stray `}`, which made one possible message:

    unknown option -- Z}

with a literal `}`, which broke on NetBSD, which has that
message.
2020-02-08 13:30:48 +01:00
Fabian Homborg
cdf6260d70 Port fish_opt tests to littlecheck
It's a wrapper for argparse, so just put it in argparse.fish.
2020-02-08 12:34:43 +01:00
Fabian Homborg
849f27912e Port parameter_expansion test to littlecheck
Just put it in expansion.fish.
2020-02-08 11:16:53 +01:00
Fabian Homborg
e9b4f5f0ab Replace references to ".../test/root/bin/fish" in the checks 2020-02-08 11:06:36 +01:00
Fabian Homborg
884f347be6 Port "test6" to littlecheck
It's related to `complete`, so put it in complete.fish
2020-02-08 10:55:59 +01:00
Fabian Homborg
109a8b07a7 Port "test5" to littlecheck
Put the switch-related stuff in switch.fish, and the wildcard-related
stuff in wildcard.fish.
2020-02-08 10:53:50 +01:00