parser test: also test variable-ids

This commit is contained in:
Michael Sippel 2023-11-11 16:26:58 +01:00
parent bd21a602f3
commit 0fb3f6e212
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -7,9 +7,18 @@ use {
#[test]
fn test_parser_id() {
let mut dict = TypeDict::new();
dict.add_varname("T".into());
assert_eq!(
Ok(TypeTerm::TypeID(TypeID::Var(0))),
dict.parse("T")
);
assert_eq!(
Ok(TypeTerm::TypeID(TypeID::Fun(0))),
TypeDict::new().parse("A")
dict.parse("A")
);
}