Skip to content

Commit

Permalink
Fixed periodic forex timestamps.
Browse files Browse the repository at this point in the history
  • Loading branch information
THLO committed Nov 20, 2023
1 parent 810baec commit 7570013
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions src/xrc/src/periodic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,46 +482,46 @@ mod test {
);
assert!(matches!(
forexes_with_timestamps_and_context[1].0,
Forex::CentralBankOfMyanmar(_)
Forex::CentralBankOfBosniaHerzegovina(_)
));
assert_eq!(forexes_with_timestamps_and_context[1].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[1].2.timestamp,
1680134400
1680220800
);
assert!(matches!(
forexes_with_timestamps_and_context[2].0,
Forex::CentralBankOfBosniaHerzegovina(_)
Forex::EuropeanCentralBank(_)
));
assert_eq!(forexes_with_timestamps_and_context[2].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[2].2.timestamp,
1680220800
1680134400
);

assert!(matches!(
forexes_with_timestamps_and_context[3].0,
Forex::EuropeanCentralBank(_)
Forex::BankOfCanada(_)
));
assert_eq!(forexes_with_timestamps_and_context[3].1, 1680134400);
assert_eq!(forexes_with_timestamps_and_context[3].1, 1680048000);
assert_eq!(
forexes_with_timestamps_and_context[3].2.timestamp,
1680134400
1680048000
);

assert!(matches!(
forexes_with_timestamps_and_context[4].0,
Forex::BankOfCanada(_)
Forex::CentralBankOfUzbekistan(_)
));
assert_eq!(forexes_with_timestamps_and_context[4].1, 1680048000);
assert_eq!(forexes_with_timestamps_and_context[4].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[4].2.timestamp,
1680048000
1680134400
);

assert!(matches!(
forexes_with_timestamps_and_context[5].0,
Forex::CentralBankOfUzbekistan(_)
Forex::ReserveBankOfAustralia(_)
));
assert_eq!(forexes_with_timestamps_and_context[5].1, 1680134400);
assert_eq!(
Expand All @@ -531,7 +531,7 @@ mod test {

assert!(matches!(
forexes_with_timestamps_and_context[6].0,
Forex::ReserveBankOfAustralia(_)
Forex::CentralBankOfNepal(_)
));
assert_eq!(forexes_with_timestamps_and_context[6].1, 1680134400);
assert_eq!(
Expand All @@ -541,42 +541,33 @@ mod test {

assert!(matches!(
forexes_with_timestamps_and_context[7].0,
Forex::CentralBankOfNepal(_)
Forex::CentralBankOfGeorgia(_)
));
assert_eq!(forexes_with_timestamps_and_context[7].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[7].2.timestamp,
1680134400
1680220800
);

assert!(matches!(
forexes_with_timestamps_and_context[8].0,
Forex::CentralBankOfGeorgia(_)
Forex::BankOfItaly(_)
));
assert_eq!(forexes_with_timestamps_and_context[8].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[8].2.timestamp,
1680220800
1680134400
);

assert!(matches!(
forexes_with_timestamps_and_context[9].0,
Forex::BankOfItaly(_)
Forex::SwissFederalOfficeForCustoms(_)
));
assert_eq!(forexes_with_timestamps_and_context[9].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[9].2.timestamp,
1680134400
);

assert!(matches!(
forexes_with_timestamps_and_context[10].0,
Forex::SwissFederalOfficeForCustoms(_)
));
assert_eq!(forexes_with_timestamps_and_context[10].1, 1680134400);
assert_eq!(
forexes_with_timestamps_and_context[10].2.timestamp,
1680134400
);
}
}

0 comments on commit 7570013

Please sign in to comment.