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

test_install: Add sleeps

To ensure timestamps don't match. Fixes #1927.
This commit is contained in:
Antonio Gurgel 2021-03-27 19:37:58 -07:00
parent 4f6041e39d
commit 01eb913c05

View file

@ -2,6 +2,7 @@ use crate::common::util::*;
use filetime::FileTime;
use rust_users::*;
use std::os::unix::fs::PermissionsExt;
use std::thread::sleep;
#[test]
fn test_install_help() {
@ -471,6 +472,7 @@ fn test_install_copy_then_compare_file_with_extra_mode() {
let mut file2_meta = at.metadata(file2);
let before = FileTime::from_last_modification_time(&file2_meta);
sleep(std::time::Duration::from_millis(1000));
scene
.ucmd()
@ -487,6 +489,8 @@ fn test_install_copy_then_compare_file_with_extra_mode() {
assert!(before != after_install_sticky);
sleep(std::time::Duration::from_millis(1000));
// dest file still 1644, so need_copy ought to return `true`
scene
.ucmd()