From 142e99a0f1da8d05a89f84e7b66824882c4fdb72 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Sat, 5 Mar 2022 03:46:45 +0800 Subject: [PATCH] nac3core: fix broken tests --- .../src/typecheck/type_inferencer/test.rs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/nac3core/src/typecheck/type_inferencer/test.rs b/nac3core/src/typecheck/type_inferencer/test.rs index 6bb64cb0..814cc38c 100644 --- a/nac3core/src/typecheck/type_inferencer/test.rs +++ b/nac3core/src/typecheck/type_inferencer/test.rs @@ -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();