nac3core: fix broken tests

This commit is contained in:
ychenfo 2022-03-05 03:46:45 +08:00
parent 79c469301a
commit 142e99a0f1
1 changed files with 22 additions and 2 deletions

View File

@ -119,7 +119,17 @@ impl TestEnvironment {
fields: HashMap::new(),
params: HashMap::new(),
});
let primitives = PrimitiveStore { int32, int64, float, bool, none, range, str, exception };
let uint32 = unifier.add_ty(TypeEnum::TObj {
obj_id: DefinitionId(8),
fields: HashMap::new(),
params: HashMap::new(),
});
let uint64 = unifier.add_ty(TypeEnum::TObj {
obj_id: DefinitionId(9),
fields: HashMap::new(),
params: HashMap::new(),
});
let primitives = PrimitiveStore { int32, int64, float, bool, none, range, str, exception, uint32, uint64 };
set_primitives_magic_methods(&primitives, &mut unifier);
let id_to_name = [
@ -217,6 +227,16 @@ impl TestEnvironment {
fields: HashMap::new(),
params: HashMap::new(),
});
let uint32 = unifier.add_ty(TypeEnum::TObj {
obj_id: DefinitionId(8),
fields: HashMap::new(),
params: HashMap::new(),
});
let uint64 = unifier.add_ty(TypeEnum::TObj {
obj_id: DefinitionId(9),
fields: HashMap::new(),
params: HashMap::new(),
});
identifier_mapping.insert("None".into(), none);
for (i, name) in ["int32", "int64", "float", "bool", "none", "range", "str", "Exception"]
.iter()
@ -239,7 +259,7 @@ impl TestEnvironment {
}
let defs = 7;
let primitives = PrimitiveStore { int32, int64, float, bool, none, range, str, exception };
let primitives = PrimitiveStore { int32, int64, float, bool, none, range, str, exception, uint32, uint64 };
let (v0, id) = unifier.get_dummy_var();