Skip to content

Commit b60de8a

Browse files
committed
rustpkg: Add a test that rustpkg install doesn't copy a non-changed file
This bug was already fixed, just needed a test. Closes #9569
1 parent a594a99 commit b60de8a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/librustpkg/tests.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,24 @@ fn no_rebuilding() {
10961096
}
10971097
}
10981098
1099+
#[test]
1100+
fn no_recopying() {
1101+
let p_id = PkgId::new("foo");
1102+
let workspace = create_local_package(&p_id);
1103+
let workspace = workspace.path();
1104+
command_line_test([~"install", ~"foo"], workspace);
1105+
let foo_lib = installed_library_in_workspace(&p_id.path, workspace);
1106+
assert!(foo_lib.is_some());
1107+
// Now make `foo` read-only so that subsequent attempts to copy to it will fail
1108+
assert!(chmod_read_only(&foo_lib.unwrap()));
1109+
1110+
match command_line_test_partial([~"install", ~"foo"], workspace) {
1111+
Success(*) => (), // ok
1112+
Fail(65) => fail!("no_recopying failed: it tried to re-copy foo"),
1113+
Fail(_) => fail!("no_copying failed for some other reason")
1114+
}
1115+
}
1116+
10991117
#[test]
11001118
fn no_rebuilding_dep() {
11011119
let p_id = PkgId::new("foo");

0 commit comments

Comments
 (0)