From da6d587a48261dee49a61faa16d24a64caf1e680 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 20 Aug 2022 02:42:52 -0400 Subject: [PATCH] Split test cases between blind types and objt types --- parser/parser_test.go | 39 ++++++++++++++++++++++++-------------- tests/parser/objt/main.arf | 21 ++++++++++++++++++++ tests/parser/type/main.arf | 17 ----------------- 3 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 tests/parser/objt/main.arf diff --git a/parser/parser_test.go b/parser/parser_test.go index d628e91..17dde9f 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -115,20 +115,6 @@ func TestType (test *testing.T) { --- type ro Basic:Int type ro BasicInit:Int 6 -type ro Complex:Obj - ro that:Basic - ro this:Basic -type ro ComplexInit:Obj - ro that:BasicInit - ro this:Basic 23 -type ro ComplexWithComplexInit:Obj - ro basic:Basic 87 - ro complex0:Complex - .that 98 - .this 2 - ro complex1:Complex - .that 98902 - .this 235 type ro IntArray:{Int ..} type ro IntArrayInit:{Int 3} 3298 @@ -137,3 +123,28 @@ type ro IntArrayInit:{Int 3} `, test) } +func TestType (test *testing.T) { + checkTree ("../tests/parser/objt", +`:arf +--- +type ro Basic:Obj + ro that:Basic + ro this:Basic +type ro ComplexInit:Obj + ro basic:Int 87 + ro complex0:Bird + .that 98 + .this 2 + ro complex1:Bird + .that 98902 + .this 235 + ro whatever:{Int 3} + 230984 + 849 + 394580 +type ro Init:Obj + ro that:String "hello world" + ro this:Int +`, test) +} + diff --git a/tests/parser/objt/main.arf b/tests/parser/objt/main.arf new file mode 100644 index 0000000..4940494 --- /dev/null +++ b/tests/parser/objt/main.arf @@ -0,0 +1,21 @@ +:arf +--- +type ro Basic:Obj + ro that:Basic + ro this:Basic + +type ro Init:Obj + ro that:String "hello world" + ro this:Int 23 + +type ro ComplexInit:Obj + ro whatever:{Int 3} + 230984 + 849 394580 + ro complex0:Bird + .that 98 + .this 2 + ro complex1:Bird + .that 98902 + .this 235 + ro basic:Int 87 diff --git a/tests/parser/type/main.arf b/tests/parser/type/main.arf index b93fc54..d7feb7e 100644 --- a/tests/parser/type/main.arf +++ b/tests/parser/type/main.arf @@ -8,20 +8,3 @@ type ro IntArray:{Int ..} type ro IntArrayInit:{Int 3} 3298 923 92 - -type ro Complex:Obj - ro that:Basic - ro this:Basic - -type ro ComplexInit:Obj - ro that:BasicInit - ro this:Basic 23 - -type ro ComplexWithComplexInit:Obj - ro complex0:Complex - .that 98 - .this 2 - ro complex1:Complex - .that 98902 - .this 235 - ro basic:Basic 87