add failing unification testcase

This commit is contained in:
Michael Sippel 2025-03-14 17:46:59 +01:00
parent fe73c47504
commit dc6626833d
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -251,6 +251,26 @@ fn test_trait_not_subtype() {
);
}
#[test]
fn test_reprtree_list_subtype() {
let mut dict = BimapTypeDict::new();
dict.add_varname("Item".into());
assert_eq!(
subtype_unify(
&dict.parse("<List~Vec <Digit 10>~Char~ReprTree>").expect(""),
&dict.parse("<List~Vec Item~ReprTree>").expect("")
),
Ok((
TypeTerm::unit(),
vec![
(dict.get_typeid(&"Item".into()).unwrap(), dict.parse("<Digit 10>~Char").unwrap())
].into_iter().collect()
))
);
}
#[test]
pub fn test_subtype_delim() {
let mut dict = BimapTypeDict::new();