Reproduce malformed argument bug

This commit is contained in:
Richard Feldman 2019-11-16 20:13:41 +00:00
parent 1e8423a368
commit 60ee53080a

View File

@ -789,6 +789,17 @@ mod test_parse {
assert_eq!(Ok(expected), actual);
}
#[test]
fn malformed_ident_due_to_underscore() {
// This is a regression test against a bug where if you included an
// underscore in an argument name, it would parse as three arguments
// (and would ignore the underscore as if it had been blank space).
let arena = Bump::new();
let actual = parse_with(&arena, "\\the_answer -> 42");
assert_eq!(Ok(MalformedClosure), actual);
}
#[test]
fn two_arg_closure() {
let arena = Bump::new();