add ensure test

This commit is contained in:
jonesmarvin8 2026-03-09 12:21:44 -04:00
parent 3c10263023
commit d029def7c7

View File

@ -67,3 +67,23 @@ pub enum NssaError {
#[error("Chain of calls is too long")]
MaxChainedCallsDepthExceeded,
}
#[derive(Debug)]
enum testError {
testErr,
}
fn test_function_ensure(cond: bool) -> Result<(), testError> {
ensure!(cond, testError::testErr);
Ok(())
}
#[test]
fn test_ensure() {
assert!(test_function_ensure(true).is_ok());
assert!(test_function_ensure(false).is_err());
}