-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.rs
More file actions
31 lines (29 loc) · 1.06 KB
/
test.rs
File metadata and controls
31 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::fs;
#[test]
fn test_sync_code() {
sync_code::Builder::new()
.add("tests/data1/target.txt", "tests/data1/source.txt")
.add("tests/data2/target.txt", "tests/data2/source.txt")
// Chain dependence
.add("tests/data3/source2.txt", "tests/data3/source.txt")
.add("tests/data3/target.txt", "tests/data3/source2.txt")
.add("tests/data4_lf/source2.txt", "tests/data4_lf/source.txt")
.add("tests/data4_lf/target.txt", "tests/data4_lf/source2.txt")
.sync();
assert_eq!(
fs::read("tests/data1/target.txt").unwrap(),
fs::read("tests/data1/source.txt").unwrap()
);
assert_eq!(
fs::read("tests/data2/target.txt").unwrap(),
fs::read("tests/data2/expected.txt").unwrap()
);
assert_eq!(
fs::read("tests/data3/target.txt").unwrap(),
fs::read("tests/data3/expected.txt").unwrap()
);
assert_eq!(
fs::read("tests/data4_lf/target.txt").unwrap(),
fs::read("tests/data4_lf/expected.txt").unwrap()
);
}