aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/uniq/tests
Commit message (Collapse)AuthorAgeFilesLines
* uniq: Fix off-by-one bug in -cD case.Dag-Erling Smørgrav2024-12-091-0/+20
| | | | | | | | | | | | | | | | When printing only duplicated lines, the first line of each set is not printed until we encounter the second. When that happens, we need to increment the repetition count between printing the first and the second line, so that if we are also printing counts, we don't print the same (pre-increment) count twice. MFC after: 1 week PR: 275764 Reported by: Yu-Sheng Ma <s110062131@m110.nthu.edu.tw> Submitted by: Daniel Tameling <tamelingdaniel@gmail.com> (original patch) Sponsored by: Klara, Inc. Reviewed by: tamelingdaniel_gmail.com, asomers, emaste Differential Revision: https://reviews.freebsd.org/D48000
* uniq: Correctly document the -D option.Dag-Erling Smørgrav2024-12-091-0/+13
| | | | | | | | | | | The -D option takes an optional argument; modify the usage message and the manual page's synopsis to correctly reflect this. Also update the tests to exercise -D with and without an argument. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D47999
* uniq tests: Make uniq_test:stdout more reliableMark Johnston2024-06-141-0/+2
| | | | | | | | | | | | | When running regression tests in paralle, this one occasionally fails because uniq exits with status 0. I believe this is because the test is a bit racy: it assumes that true(1) will exit before uniq writes to standard out. Just sleep for a bit to give the other end of the pipe to exit. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45534
* uniq: Error out if writing to the output failed.Dag-Erling Smørgrav2024-01-121-0/+15
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D43407
* uniq: Clean up and test obsolete options.Dag-Erling Smørgrav2024-01-121-0/+3
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D43402
* uniq: Fix interactive use.Dag-Erling Smørgrav2024-01-121-0/+26
| | | | | | | | | | | | | | | | | Output a line as soon as it is possible to determine that it will have to be output. For the basic case, this means output each line as it is read unless it is identical to the previous one. For the -d case, it means output the first instance as soon as the second is read, unless the -c option was also given. The -D and -u cases were already fine. Add test cases for interactive use with no options and with -d. Explicitly ignore -d when -D is also specified. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rew, kevans Differential Revision: https://reviews.freebsd.org/D43382
* uniq: Replace NetBSD's unit tests with our own.Dag-Erling Smørgrav2024-01-122-12/+150
| | | | | | | | | These new tests cover more functionality and are easier to extend. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43381
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Integrate .../contrib/netbsd-tests/usr.bin/uniq into the FreeBSD testEnji Cooper2017-01-142-0/+27
suite as .../usr.bin/uniq/tests Sponsored by: Dell EMC Isilon Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312127