Skip to content

Commit

Permalink
Add different_link test
Browse files Browse the repository at this point in the history
Closes #9 due to not being able to reproduce it.
  • Loading branch information
chrsmutti committed Apr 4, 2024
1 parent a6fe862 commit 933657d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main.rs
Expand Up @@ -473,4 +473,25 @@ mod tests {
assert!(plan.is_ok(), "everything should be fine");
assert_eq!(plan.unwrap(), expected);
}

#[test]
fn different_link() {
let path: PathBuf = "./testdata/different_link".into();
let dest: PathBuf = "./testdata/output".into();

let expected = Plan::Noop {
path: path.clone(),
dest: dest.clone(),
children: vec![Plan::Link {
path: path.join("different_link"),
dest: dest.join("different_link"),
backup: false,
replace: true,
}],
};

let plan = Plan::new(&path, &dest, false);
assert!(plan.is_ok(), "everything should be fine");
assert_eq!(plan.unwrap(), expected);
}
}
Empty file.
1 change: 1 addition & 0 deletions testdata/output/different_link

0 comments on commit 933657d

Please sign in to comment.