You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling to cargo test my code.
Basically I want to create a unit test that runs a function and checks the returned error against an Anchor Error.
When I run : assert_eq!(returns_error(), Err(error!(ErrorCode::MyError)))
I get : error[E0369]: binary operation `==` cannot be applied to type `Result<(), anchor_lang::error::Error>
Reproducible example : https://github.com/guibescos/anchor-issue-error-equals
Run : cargo test
The text was updated successfully, but these errors were encountered:
I've been struggling to
cargo test
my code.Basically I want to create a unit test that runs a function and checks the returned error against an Anchor Error.
When I run :
assert_eq!(returns_error(), Err(error!(ErrorCode::MyError)))
I get :
error[E0369]: binary operation `==` cannot be applied to type `Result<(), anchor_lang::error::Error>
Reproducible example : https://github.com/guibescos/anchor-issue-error-equals
Run :
cargo test
The text was updated successfully, but these errors were encountered: