mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
Merge pull request #2280 from jhscheer/symlink_tests
Improve symlink/hardlink handling in tests
This commit is contained in:
commit
41539df91d
3 changed files with 17 additions and 8 deletions
|
@ -129,11 +129,9 @@ fn _du_soft_link(s: &str) {
|
|||
#[test]
|
||||
fn test_du_hard_link() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
let result_ln = scene.cmd("ln").arg(SUB_FILE).arg(SUB_LINK).run();
|
||||
if !result_ln.succeeded() {
|
||||
scene.ccmd("ln").arg(SUB_FILE).arg(SUB_LINK).succeeds();
|
||||
}
|
||||
at.hard_link(SUB_FILE, SUB_LINK);
|
||||
|
||||
let result = scene.ucmd().arg(SUB_DIR_LINKS).succeeds();
|
||||
|
||||
|
|
|
@ -437,10 +437,9 @@ fn test_not_is_not_empty() {
|
|||
#[cfg(not(windows))]
|
||||
fn test_symlink_is_symlink() {
|
||||
let scenario = TestScenario::new(util_name!());
|
||||
let mut ln = scenario.cmd("ln");
|
||||
let at = &scenario.fixtures;
|
||||
|
||||
// creating symlinks requires admin on Windows
|
||||
ln.args(&["-s", "regular_file", "symlink"]).succeeds();
|
||||
at.symlink_file("regular_file", "symlink");
|
||||
|
||||
// FIXME: implement on Windows
|
||||
scenario.ucmd().args(&["-h", "symlink"]).succeeds();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue