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
1 changed files with 10 additions and 1 deletions

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")
);
}