Skip to content

Commit 75f77a5

Browse files
authored
Merge pull request #1033 from TheBlueMatt/2021-07-fix-beta
Fix lightning-persister tests for upcoming rustc changes
2 parents 7dfa886 + 8490944 commit 75f77a5

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ jobs:
2626
platform: macos-latest
2727
build-net-tokio: true
2828
build-no-std: true
29+
- toolchain: beta
30+
platform: macos-latest
31+
build-net-tokio: true
32+
build-no-std: true
2933
- toolchain: stable
3034
platform: windows-latest
3135
build-net-tokio: true
3236
build-no-std: true
37+
- toolchain: beta
38+
platform: windows-latest
39+
build-net-tokio: true
40+
build-no-std: true
3341
- toolchain: beta
3442
build-net-tokio: true
3543
build-no-std: true

lightning-block-sync/src/http.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,10 @@ pub(crate) mod client_tests {
636636
#[test]
637637
fn connect_to_unresolvable_host() {
638638
match HttpClient::connect(("example.invalid", 80)) {
639-
Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::Other),
639+
Err(e) => {
640+
assert!(e.to_string().contains("failed to lookup address information") ||
641+
e.to_string().contains("No such host"), "{:?}", e);
642+
},
640643
Ok(_) => panic!("Expected error"),
641644
}
642645
}

lightning-persister/src/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ mod tests {
135135
// Create the channel data file and make it a directory.
136136
fs::create_dir_all(get_full_filepath(path.clone(), filename.to_string())).unwrap();
137137
match write_to_file(path.clone(), filename.to_string(), &test_writeable) {
138-
Err(e) => assert_eq!(e.kind(), io::ErrorKind::Other),
138+
Err(e) => assert_eq!(e.raw_os_error(), Some(libc::EISDIR)),
139139
_ => panic!("Unexpected Ok(())")
140140
}
141141
fs::remove_dir_all(path).unwrap();
@@ -178,7 +178,7 @@ mod tests {
178178
match write_to_file(path, filename, &test_writeable) {
179179
Err(e) => {
180180
#[cfg(not(target_os = "windows"))]
181-
assert_eq!(e.kind(), io::ErrorKind::Other);
181+
assert_eq!(e.raw_os_error(), Some(libc::EISDIR));
182182
#[cfg(target_os = "windows")]
183183
assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
184184
}

0 commit comments

Comments
 (0)