Added basic test case for functions
This commit is contained in:
parent
3067b64f47
commit
2a1a48d9c5
3
analyzer/func-section.go
Normal file
3
analyzer/func-section.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package analyzer
|
||||||
|
|
||||||
|
// TODO
|
18
analyzer/func-section_test.go
Normal file
18
analyzer/func-section_test.go
Normal file
@ -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)
|
||||||
|
}
|
8
tests/analyzer/funcSection/main.arf
Normal file
8
tests/analyzer/funcSection/main.arf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
:arf
|
||||||
|
---
|
||||||
|
|
||||||
|
type ro aCString:{U8}
|
||||||
|
|
||||||
|
func ro bArbitrary
|
||||||
|
---
|
||||||
|
'puts' [cast 'hellorld\000' aCString]
|
Reference in New Issue
Block a user