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:
parent
043c009a41
commit
63203a0a68
3 changed files with 21 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue