mint error test

This commit is contained in:
thesimplekid
2023-06-14 12:04:59 -04:00
parent 9d45f4b036
commit b5d52dde2a

View File

@@ -287,3 +287,23 @@ impl Client {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_decode_error() {
let err = r#"{"code":0,"error":"Lightning invoice not paid yet."}"#;
let error = Error::from_json(err).unwrap();
match error {
Error::InvoiceNotPaid => {}
_ => panic!("Wrong error"),
}
// assert_eq!(error, Error::InvoiceNotPaid);
}
}