freebsd-src/usr.bin/uniq
Dag-Erling Smørgrav 0efd4b7922 uniq: Replace NetBSD's unit tests with our own.
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

(cherry picked from commit e762fd81e2)

uniq: Fix interactive use.

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

(cherry picked from commit 11715600e6)

uniq: Clean up and test obsolete options.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43402

(cherry picked from commit e2ec8ee02a)

uniq: Error out if writing to the output failed.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43407

(cherry picked from commit 899837e8f5)
2024-01-17 17:16:01 +01:00
..
tests uniq: Replace NetBSD's unit tests with our own. 2024-01-17 17:16:01 +01:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
uniq.1 uniq: Replace NetBSD's unit tests with our own. 2024-01-17 17:16:01 +01:00
uniq.c uniq: Replace NetBSD's unit tests with our own. 2024-01-17 17:16:01 +01:00