From 302ff76a8a8256d5e92ce8f81f97e46892ad2e64 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 16 Sep 2022 22:45:08 -0400 Subject: [PATCH] Rewrote type section test case --- parser/type_test.go | 67 +++++++++++++++++++++++--------------- tests/parser/type/main.arf | 47 +++++++++++++------------- 2 files changed, 63 insertions(+), 51 deletions(-) diff --git a/parser/type_test.go b/parser/type_test.go index 6574e83..8988ec5 100644 --- a/parser/type_test.go +++ b/parser/type_test.go @@ -6,37 +6,50 @@ func TestType (test *testing.T) { checkTree ("../tests/parser/type", false, `:arf --- -type ro aBasic:Obj - ro that:Int - ro this:Int -type ro bBitFields:Obj - ro that:Int & 1 - ro this:Int & 24 298 -type ro cInit:Obj - ro that:String "hello world" - ro this:Int 23 -type ro dInitInherit:aBasic - -- that 9384 - -- this 389 -type ro eInitAndDefine:aBasic - ro these:aBasic - ro born:Int 4 - ro in:Int - ro the:Int:3 - 9348 - 92384 - 92834 - -- this 389 - -- these - -- this 98 - -- that 9384 - +type ro aBasic:Obj: + ( + .ro that:Int + .ro this:Int + ) +type ro bBitFields:Obj: + ( + .ro that:Int & 1 + .ro this:Int:<298> & 24 + ) +type ro cInit:Obj: + ( + .ro that:String:<"hello world"> + .ro this:Int:<23> + ) +type ro dInitInherit:aBasic: + ( + .that:<9384> + .this:<389> + ) +type ro cInitAndDefine:aBasic: + ( + .ro these:aBasic: + ( + .ro born:Int:<4> + .ro in:Int + .ro the:Int:3:<9348 92384 92834> + ): + ( + .this:<98> + ) + ): + ( + .that:<9384> + .this:<389> + ) type ro fBasic:Int -type ro gBasicInit:Int 6 +type ro gBasicInit:Int:<6> type ro hIntArray:{Int ..} -type ro iIntArrayInit:Int:3 +type ro iIntArrayInit:Int:3: + < 3298 923 92 + > `, test) } diff --git a/tests/parser/type/main.arf b/tests/parser/type/main.arf index 3500e3f..20f5131 100644 --- a/tests/parser/type/main.arf +++ b/tests/parser/type/main.arf @@ -1,36 +1,35 @@ :arf --- -type ro aBasic:Obj - ro that:Int - ro this:Int +type ro aBasic:Obj:( + .ro that:Int + .ro this:Int) -type ro bBitFields:Obj - ro that:Int & 1 - ro this:Int & 24 298 +type ro bBitFields:Obj:( + .ro that:Int & 1 + .ro this:Int:<298> & 24) -type ro cInit:Obj - ro that:String "hello world" - ro this:Int 23 +type ro cInit:Obj:( + .ro that:String:<"hello world"> + .ro this:Int:<23>) -type ro dInitInherit:aBasic - -- that 9384 - -- this 389 +type ro dInitInherit:aBasic:( + .that:<9384> + .this:<389>) -type ro cInitAndDefine:aBasic - -- this 389 - ro these:aBasic - ro born:Int 4 - ro in:Int - ro the:Int:3 - 9348 92384 92834 - -- this 98 - -- that 9384 +type ro cInitAndDefine:aBasic:( + .this:<389> + .ro these:aBasic:( + .ro born:Int:<4> + .ro in:Int + .ro the:Int:3:<9348 92384 92834> + .this:<98>) + .that:<9384>) type ro fBasic:Int -type ro gBasicInit:Int 6 +type ro gBasicInit:Int:<6> type ro hIntArray:{Int ..} -type ro iIntArrayInit:Int:3 - 3298 923 92 +type ro iIntArrayInit:Int:3: + <3298 923 92>