How do I write a Rust unit test that ensures that a panic has occurred?
How do I write a Rust unit test that ensures that a panic has occurred?
#[test]
#[should_panic(expected = "invalid var name: \"1x\"")]
fn test_invalid_name() {
let s = "(let (1x 2) 3)";
let _ = parse(s);
}