From 07540e0abc1541460f2281fce0ec33d746491fd8 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 1 Oct 2022 17:12:43 -0400 Subject: [PATCH] Added more stuff to type test case --- analyzer/type-section.go | 2 +- analyzer/type-section_test.go | 10 +++++++++- tests/analyzer/typeSection/main.arf | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/analyzer/type-section.go b/analyzer/type-section.go index e40d1ce..3b757d6 100644 --- a/analyzer/type-section.go +++ b/analyzer/type-section.go @@ -23,7 +23,7 @@ type ObjectMember struct { // even if there is a private permission in another module, we still // need to include it in the semantic analysis because we need to know - // how many members objects have. + // what members objects have. permission types.Permission what Type diff --git a/analyzer/type-section_test.go b/analyzer/type-section_test.go index afdbab5..832370a 100644 --- a/analyzer/type-section_test.go +++ b/analyzer/type-section_test.go @@ -4,8 +4,16 @@ import "testing" func TestTypeSection (test *testing.T) { checkTree ("../tests/analyzer/typeSection", false, -`typeSection ../tests/analyzer/typeSection.basicInt +`typeSection ro ../tests/analyzer/typeSection.aBasicInt type 1 basic Int arg uint 5 +typeSection ro ../tests/analyzer/typeSection.bOnBasicInt + type 1 basic aBasicInt +typeSection ro ../tests/analyzer/typeSection.cBasicObject + type 1 basic Obj + member ro that + type 1 basic Int + member ro this + type 1 basic Int `, test) } diff --git a/tests/analyzer/typeSection/main.arf b/tests/analyzer/typeSection/main.arf index cceaf8c..bd58795 100644 --- a/tests/analyzer/typeSection/main.arf +++ b/tests/analyzer/typeSection/main.arf @@ -1,4 +1,10 @@ :arf --- -type ro basicInt:Int 5 +type ro aBasicInt:Int 5 + +type ro bOnBasicInt:aBasicInt + +type ro cBasicObject:Obj + ro that:Int + ro this:Int