test: use mtime for -ot and fix direction of comparison#5441
test: use mtime for -ot and fix direction of comparison#5441sylvestre merged 1 commit intouutils:mainfrom
Conversation
- Use the file modification time instead of the creation time (matches GNU coreutils documentation) - Fix direction of comparison (a < b instead of a > b) - Extend test case to cover both the 0 and 1 exit code cases
|
Here is the specific coreutils documentation page I was referring to. I wasn't sure how to test on android, so left the #cfg check in place for that target environment. For musl testing I used |
|
Looks good :) |
I ended up finding this issue while running the tests on OpenBSD and digging into why this test case was failing. Eventually I found out OpenBSD was providing creation times of "0".. This led me to checking the OpenBSD "test" implementation and finding out that there both -nt and -ot used mtime. Once I changed the uutils/coreutils "-ot" implementation to use the modified time, it was easier to spot that the -nt implementation on the line above was identical to "-ot" which raised a red flag.. 😃 |
Use the file modification time instead of the creation time (matches GNU coreutils documentation)
Fix direction of comparison (a < b instead of a > b)
Extend test case to cover both the 0 and 1 exit code cases