Skip to content

Commit b48bac7

Browse files
committed
Adapt unit tests to Windows CRLF
1 parent 64ea6a0 commit b48bac7

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/dbfile/test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_new() {
1515
if cfg!(target_family = "unix") {
1616
assert_eq!(dbfile_no_id.size, 35149);
1717
} else {
18-
assert_eq!(dbfile_no_id.size, 35149);
18+
assert_eq!(dbfile_no_id.size, 35823);
1919
};
2020
assert_eq!(dbfile_no_id.permissions, utils::get_unix_permissions(&dbfile_no_id.path));
2121

@@ -70,8 +70,8 @@ fn test_fmt_debug() {
7070
\"LICENSE\", 35149, 100644)"
7171
} else {
7272
"(\"FIXED_ID\", \"FIXED_TIMESTAMP\", \
73-
\"edb0016d9f8bafb54540da34f05a8d510de8114488f23916276bdead05509a53\", \
74-
\"LICENSE\", 35149, 0)"
73+
\"209ba691a607610997f45be93529e6f582c1316a50a85af3ff257457a85d8f94\", \
74+
\"LICENSE\", 35823, 0)"
7575
};
7676
assert_eq!(out, expected);
7777
}
@@ -93,8 +93,8 @@ fn test_fmt() {
9393
PATH: LICENSE, SIZE: 35149, PERMISSIONS: 100644)"
9494
} else {
9595
"DBFile(ID: FIXED_ID, TIMESTAMP: FIXED_TIMESTAMP, \
96-
HASH: edb0016d9f8bafb54540da34f05a8d510de8114488f23916276bdead05509a53, \
97-
PATH: LICENSE, SIZE: 35149, PERMISSIONS: 0)"
96+
HASH: 209ba691a607610997f45be93529e6f582c1316a50a85af3ff257457a85d8f94, \
97+
PATH: LICENSE, SIZE: 35823, PERMISSIONS: 0)"
9898
};
9999
assert_eq!(out, expected);
100100
}

src/utils/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn test_get_file_end() {
106106
assert_ne!(get_file_end("LICENSE", 0), 100);
107107
// CRLF matter
108108
if get_os() == "windows"{
109-
assert_eq!(get_file_end("LICENSE", 0), 35149);
109+
assert_eq!(get_file_end("LICENSE", 0), 35823);
110110
}else{
111111
assert_eq!(get_file_end("LICENSE", 0), 35149);
112112
}
@@ -173,7 +173,7 @@ fn test_get_field() {
173173
fn test_get_file_size() {
174174
// CRLF matter
175175
if get_os() == "windows"{
176-
assert_eq!(get_file_size("LICENSE"), 35149);
176+
assert_eq!(get_file_size("LICENSE"), 35823);
177177
}else{
178178
assert_eq!(get_file_size("LICENSE"), 35149);
179179
}

0 commit comments

Comments
 (0)