From 2a1a48d9c5de32c12eab9df07d99fce2294d8cdc Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 18 Oct 2022 15:00:17 -0400 Subject: [PATCH] Added basic test case for functions --- analyzer/func-section.go | 3 +++ analyzer/func-section_test.go | 18 ++++++++++++++++++ tests/analyzer/funcSection/main.arf | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 analyzer/func-section.go create mode 100644 analyzer/func-section_test.go create mode 100644 tests/analyzer/funcSection/main.arf diff --git a/analyzer/func-section.go b/analyzer/func-section.go new file mode 100644 index 0000000..f9c26bb --- /dev/null +++ b/analyzer/func-section.go @@ -0,0 +1,3 @@ +package analyzer + +// TODO diff --git a/analyzer/func-section_test.go b/analyzer/func-section_test.go new file mode 100644 index 0000000..389d7cd --- /dev/null +++ b/analyzer/func-section_test.go @@ -0,0 +1,18 @@ +package analyzer + +import "testing" + +func TestFuncSection (test *testing.T) { + checkTree ("../tests/analyzer/funcSection", false, +` +typeSection ro ../tests/analyzer/funcSection.aCString + type 1 pointer {Int} +funcSection ro ../tests/analyzer/funcSection.bArbitrary + block + arbitraryPhrase + command 'puts' + cast + type aCString + arg string 'hellorld` + "\000" + `' +`, test) +} diff --git a/tests/analyzer/funcSection/main.arf b/tests/analyzer/funcSection/main.arf new file mode 100644 index 0000000..1e36ef1 --- /dev/null +++ b/tests/analyzer/funcSection/main.arf @@ -0,0 +1,8 @@ +:arf +--- + +type ro aCString:{U8} + +func ro bArbitrary + --- + 'puts' [cast 'hellorld\000' aCString]