Skip to content

Commit

Permalink
Add test for ErrorBox
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Apr 7, 2021
1 parent 3904687 commit 6f18680
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bindings/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ impl Instance {
mod tests {
use super::*;

#[test]
fn error_box() {
let mut err = FizzyErrorBox::new();
assert_ne!(unsafe { err.as_mut_ptr() }, std::ptr::null_mut());
assert_eq!(err.code(), 0);
assert_eq!(err.message(), "");
assert_eq!(format!("{}", err), "0 []");
}

#[test]
fn value_conversions() {
// NOTE: since the underlying type is a union, a conversion or access to other members is undefined
Expand Down

0 comments on commit 6f18680

Please sign in to comment.