-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit test for currency serialization/deserialization #256
Conversation
6386a98
to
0574b9f
Compare
src/utils.rs
Outdated
fn test_de_invalid_currency_code() { | ||
let result: Result<CurrencyCodeWrapper, _> = | ||
serde_json::from_str("{\"currency_code\":\"XXX\"}"); | ||
let err_msg = result.err().unwrap().to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let err_msg = result.unwrap_err();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I missed that one and it makes sense. Funny fact though, when I did change it, it complains because CurrencyWrapper
does not implements std::fmt::Debug
. The reason is because .unwrap_err()
will panic with the value if the result is of type Ok()
. I did the change in 62a3702.
62a3702
to
7dbd42b
Compare
src/utils.rs
Outdated
#[cfg(test)] | ||
mod tests { | ||
|
||
#[cfg(feature = "fare-v2")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line now (feature) ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 487f3d0.
7dbd42b
to
47e6378
Compare
487f3d0
to
22b59a3
Compare
No description provided.