mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-03-11 06:33:09 +00:00
add ensure test
This commit is contained in:
parent
3c10263023
commit
d029def7c7
@ -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());
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user