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 e762fd81e253d4ae9b9f7d2e65cf448633bbe527)
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 11715600e626cf6cc4b4f564af97f6ae1e5fb0be)
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 e2ec8ee02a33e39b8ff86a56e8a1ef5e84ac7e62)
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 899837e8f5741f9a847b63d9e7c8b76ccc033ab5)