This diff primarily adds/removes flags to make the tests compatible with sort. Two tests are removed. One test is changed to expect fail due to a bug.
Rather than commenting out tests, it is better to add atf_skip calls at the beginning of each test. This reduces the number of local modifications to this file, which makes merging easier when changes are imported from NetBSD.
These are a lot of changes to an upstream (NetBSD) provided file without good annotations (please look for "Begin FreeBSD" elsewhere).
As @markj noted, making broad changes like this will definitely make my job a lot harder when I update this project. Using atf_expect_fail is an alternative to atf_skip, as it would trigger a legitimate failure if the code doesn't fail as expected.
Please put FreeBSD-specific assertions in separate test cases as well if they are FreeBSD specific.
Flags for sort can come after filenames; commands like sort in -r don't treat -r as a filename. Since +0 is a valid flag, then sort in +0 shouldn't take +0 as a filename in this case.
Oof, that's weird. Looking at NetBSD's sort, they appear to stop mangling + options after encountering an option that doesn't start with - or +. We could perhaps implement that in D30234 as well. But our sort already behaves the same as GNU sort in this case, so it's probably better to keep things as they are.