You can utilize [trybuild](https://docs.rs/trybuild/1.0.30/trybuild/) crate for asserting the error message