Translate asset and material parity tests
Some checks failed
Rust API gates / api-gates (push) Has been cancelled
Some checks failed
Rust API gates / api-gates (push) Has been cancelled
This commit is contained in:
@@ -51,6 +51,8 @@ pub enum Error {
|
||||
ArgumentNull,
|
||||
/// An argument value or length was invalid.
|
||||
Argument,
|
||||
/// The requested operation was not valid in the object's current state.
|
||||
InvalidOperation,
|
||||
/// An index or destination buffer boundary was exceeded.
|
||||
IndexOutOfRange,
|
||||
/// An operation observed a requested cancellation.
|
||||
@@ -63,7 +65,11 @@ impl Error {
|
||||
pub const fn csharp_member(self) -> Option<&'static str> {
|
||||
match self {
|
||||
Self::NotImplemented(error) => Some(error.csharp_member()),
|
||||
Self::ArgumentNull | Self::Argument | Self::IndexOutOfRange | Self::Cancelled => None,
|
||||
Self::ArgumentNull
|
||||
| Self::Argument
|
||||
| Self::InvalidOperation
|
||||
| Self::IndexOutOfRange
|
||||
| Self::Cancelled => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,6 +86,7 @@ impl fmt::Display for Error {
|
||||
Self::NotImplemented(error) => error.fmt(formatter),
|
||||
Self::ArgumentNull => formatter.write_str("required argument was null"),
|
||||
Self::Argument => formatter.write_str("argument was invalid"),
|
||||
Self::InvalidOperation => formatter.write_str("operation was invalid for this state"),
|
||||
Self::IndexOutOfRange => formatter.write_str("index was out of range"),
|
||||
Self::Cancelled => formatter.write_str("operation was cancelled"),
|
||||
}
|
||||
@@ -152,5 +159,9 @@ mod tests {
|
||||
.expect("placeholder panic must retain its visible marker");
|
||||
assert_eq!(message, &format!("{PANIC_PREFIX}{MEMBER}"));
|
||||
assert!(not_implemented::<()>(MEMBER).is_err());
|
||||
assert_eq!(
|
||||
Error::InvalidOperation.to_string(),
|
||||
"operation was invalid for this state"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user