Commit Graph

14 Commits

Author SHA1 Message Date
Fabian Boehm
88e578a9ed Remove superfluous CHECK lines
Oops
2022-09-21 18:37:38 +02:00
Fabian Boehm
3dded49b9b tests/checks/test: Attempt to fix on old Ubuntu
For unknown reasons, the i686 launchpad builders fail on this date,
but apparently not the others.

Let's just remove it, we've tested dates older than the epoch, this is
slightly redundant.
2022-09-21 18:20:05 +02:00
Fabian Boehm
9493e7725f tests/test: Don't use seconds in the mtime
This fails on old Ubuntu with:

> touch: invalid date format ‘190112112040.39’

Because we don't actually need the seconds here, we just use minute
resolution. It's fine.

Also use `path mtime`, because that's a portable way to get the mtime.
2022-09-20 16:10:17 +02:00
Mahmoud Al-Qudsi
472fc3ec10 [tests] Fix pre-epoch test workaround on non-Linux
I forgot `stat` is non-portable. There's no great way to portably get a
machine-readable representation of stat(2) for a file. I don't want to ship our
own lstat(2) wrapper executable just for this test and don't want to fork out to
python or perl for this either - I just wanted to get the tests to pass under
WSL :'(

Anyway, just give up and make it skip just for WSL. If another OS fails this
test in the future, the comments and existing workaround will make it easy to
figure out what the problem is and what needs to be done. We'll cross that
bridge when we get there.
2022-09-16 19:38:49 -05:00
Mahmoud Al-Qudsi
613ecfc7e4 Fix pre-epoch test workaround
It turns out that not all systems print an unsigned integer as the output of
`stat -c %Y xxx` and the leading `-` can be misinterpreted as a parameter to
`string match`.
2022-09-16 18:58:21 -05:00
Mahmoud Al-Qudsi
30cd330b98 Fix test.fish pre-epoch comparisons on WSL and others
There's no guarantee (nor requirement) that the filesystem support pre-epoch
modification dates. If it doesn't, the `test` tests were failing to get the
expected results.

Skip the test if it seems the fs doesn't support pre-epoch timestamps
(determined by pre-epoch mt of `oldest` evaluating to 0 or the unix epoch).
2022-09-16 16:24:00 -05:00
Aaron Gyes
77f6afa501 Add testcases for [ extensions
Some sanity checks for -ot, -nt, -ef

Try negative mtime values too, there was interesting behavior
there during development.
2022-07-16 12:40:36 -07:00
Fabian Homborg
77bac22741 test: Also print proper caret for too many arguments
This case is handled specially for unknown reasons and was missed in #6030.
2021-12-24 16:08:41 +01:00
Fabian Homborg
6c5c8e03c5 Move the numeric locale tests to a different file
This lets us check for locales once, and to have littlecheck mark the
test as skipped.
2021-08-17 15:36:07 +02:00
Fabian Homborg
09b8471f5c Test numeric locale
This allows us to test that `test` takes numbers with decimal point even in comma-using locales,
to stop those pesky americans from breaking everything again.

(and yes, we use french to keep myself honest)
2021-07-29 17:20:20 +02:00
Fabian Homborg
3cccb77b52 Make test error when number is invalid nicer
This would print the default "Argument is invalid" error string, which
is *true* but not super obvious, because `test` doesn't always perform
numeric conversion, and that's the bit that failed here.
2021-04-24 11:18:58 +02:00
Fabian Homborg
9d2bf248ee test: Add tests for error messages 2020-06-07 16:23:29 +02: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
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