aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-11-17Update bc for 1.1 releaseGavin Howard
2018-11-13basename: -s SUFFIX.Elliott Hughes
AOSP doesn't need -a specifically, but since it's needed for -s we may as well accept it too.
2018-10-06date.test: add some tests.Elliott Hughes
These are reasonable examples I found in AOSP. I also came across "today" (which is the same as the more obvious "now"), "yesterday", "7 days ago" and "1 month ago". I'm not sure how far down that rabbit hole we want to go. But these ones at least seem reasonable.
2018-08-29added fold test for discussionmaqsood3525@live.com
2018-08-28Add a test case raised on the list.Rob Landley
2018-08-08Add bc (and its tests) to pendingGavin Howard
2018-08-04wc: fix the column width heuristics even further.Elliott Hughes
This was found by https://kernel.googlesource.com/pub/scm/linux/kernel/git/shuah/linux-kselftest/+/master/tools/testing/selftests/splice/default_file_splice_read.sh which broke after the recent change. Plus this actually fixes another of our existing test failures on the host. I'm assuming we don't want to try the "exact fit" heuristics until we have a concrete need for them. (I haven't fully understood the circumstances under which they're used, though the two remaining host test failures appear to be because of them.) Bug: http://b/111891791 Test: ran tests
2018-08-04Add tests for grep with implicit/explicit BREs and explicit EREs.Elliott Hughes
This is in POSIX, but pcre2grep gets it wrong (https://bugs.exim.org/show_bug.cgi?id=2294).
2018-08-04file: slightly improve .class, add .dex.Elliott Hughes
2018-07-09Fix wc column widths.Elliott Hughes
2018-07-04diff: add timestamps to the ---/+++ lines and --color.Elliott Hughes
(My apologies for mixing these two unrelated changes up.)
2018-06-23Add a couple more fmt tests.Rob Landley
2018-06-14More cut tests.Rob Landley
2018-06-12Add tests for file stdin behavior.Elliott Hughes
2018-05-07remove also "symlink" after file.testReverend Homer
2018-05-06Support fractional seconds (and other time units) in `top -d`.Elliott Hughes
LTP uses `top -d 0.1`, which isn't convincingly useful, but general support for other time units might be useful, and switching to xparsetime addresses both at once. Also fix 3169d948c049664bcf7216d4c4ae751881099d3e where I mistakenly treated `rev` and `toys.optflags&FLAG_b` as interchangeable. (Without this second fix, `top -b` looks fine but `top` is broken!) Also fix xparsetime to reject input such as "monkey" or "1monkey".
2018-05-03Add uuidgen.Elliott Hughes
Reuse create_uuid, but make it match the current RFC.
2018-04-08Add readlink -m to show where a missing path would be.Rob Landley
Note: ubuntu will show -m through a file, this treat that as error.
2018-04-08Ubuntu's ln -f dies if you do "ln -s link link; ln -sf / link". Toybox'sRob Landley
ln -f does the rm and retry if the first attempt fails for any reason. So if you run the readlink test with an ubuntu host $PATH, it fails, but it works with a toybox host path.
2018-03-26Rename demo_human_readable.c->demo_number.c and have it do atolx() too.Rob Landley
2018-03-12Add xxd -o.Elliott Hughes
2018-01-23Fix hang in losetup test.Elliott Hughes
Switch the printf over to %s because the input is actually hex (so %d is wrong), but without the leading "0x" that %x would require. For some reason the NODE assignment wasn't providing any input to awk (hence the hang), and awk wasn't looking for the correct field anyway. The tests still fail for me: losetup: /dev/block/loop0: No such device or address losetup: /dev/block/loop0: No such device or address losetup: file: No such file or directory losetup: needs 1 arg (see "losetup --help") But at least now they allow the other tests to continue!
2018-01-09Add the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.Elliott Hughes
Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for another day, but at least the tests are easy... (These tests pass with TEST_HOST and on the toolbox versions, but the toybox toys are in pending and very broken.)
2017-12-26Add xxd -i (and xxd -ri).Elliott Hughes
The original xxd doesn't support -r with -i. The original also outputs "unsigned char name[] = { ... };" for input other than stdin, but that actually makes it less useful --- many languages support array initializers, but far fewer support that exact declaration syntax. Also fix the -c range checking and defaulting: ><= in the argument string only works for floating point arguments. Bug: http://b/64711851
2017-12-26Fix xargs -0 with -n.Elliott Hughes
Also make -0 and -E mutually exclusive (rather than just ignore -E with -0). Bug: https://github.com/landley/toybox/issues/78
2017-12-24Add fmt.Elliott Hughes
A very simple implementation of fmt, good enough for my daily use of !!fmt in vi to reflow checkin comments like this.
2017-12-19killall should kill scripts too.Elliott Hughes
Found running LTP file system tests on Android. Bug: http://b/70627145
2017-10-31Only show LABEL= when there is one.Rob Landley
2017-10-22Insmod dummy for ifconfig tests, and "pointopoint" only has two t's.Rob Landley
2017-09-09Redo/add seq precision logic.Rob Landley
Josh Gao hit a case where "seq 1000000 1000001" output 1e+06, and while he was there changed several things to work like existing seq implementations. I changed a couple back (commenting out the test cases) until somebody came come up with a reason (or existing use case) to do it that way.
2017-09-06Tighten up wc -m tests (which no longer depend on $LANG).Rob Landley
2017-08-23Fix iconv build and add trivial test.Elliott Hughes
2017-08-04Don't unnecessarily use printf in wc.test when echo will do.Elliott Hughes
(And is much faster if your shell doesn't have a builtin printf.)
2017-07-25Test that our rm -rf can zap chmod 000 directories. (Skip test on hostRob Landley
because ubuntu's can't.)
2017-07-23Add basic env.testRob Landley
2017-07-07Posix says strings should only output hits that end with NUL or newline.Rob Landley
We don't currently do that, but a test suite checking that we don't do that is requiring us to violate posix to pass it.
2017-07-07strings -t oxd testsIlya Kuzmich
2017-07-07Fix dd tests so TEST_HOST passes. (Ubuntu's dd doesn't support hex valuesRob Landley
and don't expect a specific error message, just that it errored.)
2017-07-02strings tests and bugfixesIlya Kuzmich
Fixes missing newline in output if last byte of the input is string. Fixes one-off offset bug. Adds strings tests. Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
2017-06-27teach head -cIlya Kuzmich
Not POSIX, but implemented in coreutils, busybox and freebsd.
2017-05-28teach head -v and -qIlya Kuzmich
Not POSIX, but implemented in coreutils and busybox. Tests use sed to compensate for the stdin naming difference. Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
2017-05-19Add bzip2 support to tar.Elliott Hughes
Also trivial cleanup of pipe -> xpipe. Bug: http://b/38215123
2017-05-19Implement date %N, loosely inspired by Elliott Hughes's patch.Rob Landley
I didn't implement %37N's ability to insert zeroes, so removed those two tests. If you really need it, I can add the divide loop back.
2017-05-11Switch to testcmd and add "-e all but \c" test.Rob Landley
2017-05-11Make fewer assumptions about the shell in echo.test.Elliott Hughes
This test fails with mksh, but we're not here to test mksh.
2017-04-26Elliott wants to run the toybox tests on android host and there's an sh butRob Landley
it isn't toysh, so test for a bash alias.
2017-04-25Forgot to check in one of the files for bzcat.testRob Landley
2017-04-17Use $(( rather than $[ for arithmetic in expand.test.Elliott Hughes
I can't find any reference to $[ for arithmetic on the bash man page, but it seems to be a synonym for $((. mksh doesn't support this, so the expand tests that use it fail on Android. No other toybox tests are using $[.
2017-04-17Make ls.test work without awk.Elliott Hughes
2017-04-15Speed up tail.test for shells without builtin printf.Elliott Hughes
The test only needs echo, and Android currently doesn't use mksh's builtin printf; the toybox printf is fuller featured and less buggy, but a lot slower to call in a loop like this (and mksh doesn't fall back to the printf on the path if given something it can't handle, so we can't have the best of both worlds). Without this hack, the tail test takes as long as all the other tests put together.