aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2019-02-13find: fix -path/-ipath and add -wholename/-iwholename synonyms.Elliott Hughes
Plus new tests.
2019-02-13date: more test cleanup.Elliott Hughes
Add the SKIP_HOST=1 for the POSIX inputs to -d that coreutils doesn't support. Fix some comments now Rob's pointed out that the "weird" format was just POSIX with implicit CCYY or CC. (I was confused because coreutils rejects them [as it rejects all POSIX input to -d], but busybox does accept them, but interprets them differently, as explained in the test comments.) Also rename the tests to make it clearer that these are all POSIX format.
2019-02-13sed: fix endless loop in "b loop" test.Elliott Hughes
Very few places actually check for errors from emit, and I actually see the same endless loop from "sed (GNU sed) 4.4" on current Debian, so I'm not sure this isn't Broken As Designed, but an endless loop spewing "short write" (or saying nothing, in the case of GNU sed) really doesn't feel like useful behavior in face of EPIPE, which really isn't going to fix itself. Certainly not being able to run the sed tests to completion is pretty annoying --- which is why, unless we remove this test as invalid, we should probably also add a SKIP_HOST=1 to the "b loop" test. Note that even with this fix you'll see the error twice: sed: short write: Broken pipe sed: short write: Broken pipe Once from the first = command to fail, and then another from the !FLAG(n) flush of the pattern space.
2019-02-12sed: fix substitution of empty capturing groups.Elliott Hughes
The test for \N where N was larger than the number of capturing groups in the regular expression was incorrect, and firing for cases such as matching __(ARM_)?NR_([a-z]*) against __NR_read, where the first group is empty (because it failed to match) but the second group did match "read". Use regex_t's re_nsub for the error check, and treat rm_so == -1 as a signal to just copy nothing into the result. (Found trying to build minijail in AOSP.)
2019-02-11date: some fixes.Elliott Hughes
Add support for more input formats, primarily the ISO formats used by the AOSP build. I've improved/added to the tests a bit to cover these changes, and to explain the reasons for the various remaining test failures (none of which are regressions caused by this patch).
2019-02-04sort -o: fix behavior when output file is one of the input files.Elliott Hughes
Bug: http://b/123902291
2019-02-04unzip tests.Elliott Hughes
I'm switching to a new laptop, and found this from 2017-07. I think these are the tests used for the Android libziparchive-based unzip. They pass on the host.
2019-01-18xargs: make --help match reality.Elliott Hughes
Implement -p, -t, and -r. Add some missing tests. Move -L and -x back to TODO since they're not implemented and I haven't yet even understood what they're supposed to do.
2019-01-12Fix cp permissions when copying symlink contents, and add test.Rob Landley
2019-01-12sed: add -z.Elliott Hughes
Used to construct SELinux policies in the AOSP build. I left loopfiles_lines with its hard-coded '\n' because although cut(1) also has a -z option, I can't find any case where it's used in any of the codebases searchable by me. (And fmt(1), the other user, doesn't even have the option.) YAGNI. Bug: http://b/122744241
2019-01-11Fix b ending with }Rob Landley
For a definition of "fix" that's even _more_ of a deviation from posix, but matches what debian does...
2019-01-11sed: add test for AOSP build breakage.Elliott Hughes
Bug: http://b/122744241
2019-01-07Use `return` rather than `continue` to make bash 4.4 happy.Elliott Hughes
Otherwise we get this error: continue: only meaningful in a 'for', 'while', or 'until' loop
2018-12-19First stab at sort -VRob Landley
2018-12-19Fix sort -x attached to a key.Rob Landley
2018-12-19md5sum/sha1sum: add --status and --check, fix --check with multiple files.Elliott Hughes
Annoyingly coreutils and busybox both have the --status functionality, but coreutils only accepts --status and busybox only accepts -s. Although all extant users known to me use --status I've supported both (a) for maximum compatibility and (b) because Rob hates longopts :-) Also, -c/--check don't take argument(s): they alter the interpretation of all the FILE... arguments. I removed a bunch of dead code here, but I couldn't switch us over to loopfiles_lines because I didn't want to regress on the "warn if any check file contains no hashes", and loopfiles_lines doesn't give you any way to recognize that you've moved on to the next file.
2018-12-18Add grep tests to "make tests".Rob Landley
2018-12-17A couple more grep tests, and slightly use dlist_terminate() for the loops.Rob Landley
2018-12-06mktemp: just the missing tests.Elliott Hughes
2018-12-04mktemp: more tests, more fixes.Elliott Hughes
I realized (after being questioned about my motivation) that I hadn't added a test for the -u behavior. Adding the missing test confirmed the usual "if there isn't a test, the code is broken", but now I think I actually understand how we're supposed to choose between DIR, $TMPDIR, and /tmp. I've added more tests to back this up, and rewritten the code one more time so that we pass all the tests.
2018-12-04Also remove SORT_BIG from sort.test.Rob Landley
2018-12-02Teach testcmd to say short name rather than full path.Rob Landley
2018-12-02Merge runtest.sh into test.sh.Rob Landley
2018-12-01Stop testing the shell builtin, test the actual command.Rob Landley
2018-11-28mktemp: add -t and fix behavior.Elliott Hughes
The new tests pass on the host (coreutils 8.28) and with toybox after this patch is applied.
2018-11-20Chmod +x tests that pass with VERBOSE=fail and -x on tests needing work.Rob Landley
2018-11-20Fix up some tests for running as a normal user.Rob Landley
2018-11-17dirname: support multiple arguments.Elliott Hughes
2018-11-17Cosmetic leanup (hide stderr prompts).Rob Landley
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