forked from mcu-rust/sync-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rs
More file actions
25 lines (23 loc) · 857 Bytes
/
test.rs
File metadata and controls
25 lines (23 loc) · 857 Bytes
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
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")
.sync();
assert_eq!(
fs::read_to_string("tests/data1/target.txt").unwrap(),
fs::read_to_string("tests/data1/source.txt").unwrap()
);
assert_eq!(
fs::read_to_string("tests/data2/target.txt").unwrap(),
fs::read_to_string("tests/data2/expected.txt").unwrap()
);
assert_eq!(
fs::read_to_string("tests/data3/target.txt").unwrap(),
fs::read_to_string("tests/data3/expected.txt").unwrap()
);
}