1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

test: add -N FILE exists and has been modified since it was last read

Upstream: tests/misc/test-N.sh
This commit is contained in:
Sylvestre Ledru 2022-09-25 03:33:36 +02:00
parent 043c009a41
commit 63203a0a68
3 changed files with 21 additions and 3 deletions

View file

@ -882,3 +882,16 @@ fn test_bracket_syntax_version() {
.succeeds()
.stdout_matches(&r"\[ \d+\.\d+\.\d+".parse().unwrap());
}
#[test]
#[allow(non_snake_case)]
fn test_file_N() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
scene.ucmd().args(&["-N", "regular_file"]).fails();
// The file will have different create/modified data
// so, test -N will return 0
sleep(std::time::Duration::from_millis(1000));
at.touch("regular_file");
scene.ucmd().args(&["-N", "regular_file"]).succeeds();
}