Skip to content

Commit 37f7343

Browse files
BertBert
authored andcommitted
GH-598: added special lines for Windows
1 parent 9378ffe commit 37f7343

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

node/src/accountant/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3478,13 +3478,28 @@ mod tests {
34783478
}
34793479

34803480
#[test]
3481+
#[cfg(windows)]
3482+
#[should_panic(
3483+
expected = "internal error: entered unreachable code: ScanAlreadyRunning { \
3484+
cross_scan_cause_opt: None, started_at: SystemTime { intervals: 116444736000000000 } } \
3485+
should be impossible with PendingPayableScanner in automatic mode"
3486+
)]
3487+
fn initial_pending_payable_scan_hits_unexpected_error() {
3488+
test_initial_pending_payable_scan_hits_unexpected_error()
3489+
}
3490+
3491+
#[test]
3492+
#[cfg(not(windows))]
34813493
#[should_panic(
34823494
expected = "internal error: entered unreachable code: ScanAlreadyRunning { \
34833495
cross_scan_cause_opt: None, started_at: SystemTime { tv_sec: 0, tv_nsec: 0 } } \
34843496
should be impossible with PendingPayableScanner in automatic mode"
34853497
)]
34863498
fn initial_pending_payable_scan_hits_unexpected_error() {
3487-
init_test_logging();
3499+
test_initial_pending_payable_scan_hits_unexpected_error()
3500+
}
3501+
3502+
fn test_initial_pending_payable_scan_hits_unexpected_error() {
34883503
let mut subject = AccountantBuilder::default()
34893504
.consuming_wallet(make_wallet("abc"))
34903505
.build();

node/src/accountant/scanners/scan_schedulers.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl NewPayableScanDynIntervalComputer for NewPayableScanDynIntervalComputerReal
187187
.duration_since(last_new_payable_scan_timestamp)
188188
.unwrap_or_else(|_| {
189189
panic!(
190-
"Unexpected now ({:?}) earlier than past timestamp ({:?})",
190+
"Now ({:?}) earlier than past timestamp ({:?})",
191191
now, last_new_payable_scan_timestamp
192192
)
193193
});
@@ -515,11 +515,26 @@ mod tests {
515515
}
516516

517517
#[test]
518+
#[cfg(windows)]
518519
#[should_panic(
519-
expected = "Unexpected now (SystemTime { tv_sec: 999999, tv_nsec: 0 }) earlier than past \
520-
timestamp (SystemTime { tv_sec: 1000000, tv_nsec: 0 })"
520+
expected = "Now (SystemTime { intervals: 116454735990000000 }) earlier than past timestamp \
521+
(SystemTime { intervals: 116454736000000000 })"
521522
)]
522523
fn scan_dyn_interval_computer_panics() {
524+
test_scan_dyn_interval_computer_panics()
525+
}
526+
527+
#[test]
528+
#[cfg(not(windows))]
529+
#[should_panic(
530+
expected = "Now (SystemTime { tv_sec: 999999, tv_nsec: 0 }) earlier than past timestamp \
531+
(SystemTime { tv_sec: 1000000, tv_nsec: 0 })"
532+
)]
533+
fn scan_dyn_interval_computer_panics() {
534+
test_scan_dyn_interval_computer_panics()
535+
}
536+
537+
fn test_scan_dyn_interval_computer_panics() {
523538
let now = UNIX_EPOCH
524539
.checked_add(Duration::from_secs(1_000_000))
525540
.unwrap();

0 commit comments

Comments
 (0)