2022-09-18 06:41:06 +00:00
|
|
|
package analyzer
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestTypeSection (test *testing.T) {
|
|
|
|
checkTree ("../tests/analyzer/typeSection", false,
|
2022-10-13 06:26:05 +00:00
|
|
|
`typeSection ro ../tests/analyzer/typeSection/required.aBasic
|
2022-10-13 03:25:21 +00:00
|
|
|
type 1 basic Int
|
2022-10-13 06:26:05 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection/required.bBird
|
|
|
|
type 1 basic Obj
|
|
|
|
member rw wing
|
|
|
|
type 1 basic Int
|
2022-10-19 03:39:07 +00:00
|
|
|
uintLiteral 2
|
2022-10-13 03:25:21 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.aBasicInt
|
2022-09-30 00:28:51 +00:00
|
|
|
type 1 basic Int
|
2022-10-19 03:39:07 +00:00
|
|
|
uintLiteral 5
|
2022-10-01 21:12:43 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.bOnBasicInt
|
|
|
|
type 1 basic aBasicInt
|
|
|
|
typeSection ro ../tests/analyzer/typeSection.cBasicObject
|
|
|
|
type 1 basic Obj
|
|
|
|
member ro that
|
2022-10-13 06:26:05 +00:00
|
|
|
type 1 basic UInt
|
2022-10-01 21:12:43 +00:00
|
|
|
member ro this
|
|
|
|
type 1 basic Int
|
2022-10-13 06:26:05 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.dInheritFromOther
|
|
|
|
type 1 basic aBasic
|
|
|
|
typeSection ro ../tests/analyzer/typeSection.eInheritObject
|
|
|
|
type 1 basic cBasicObject
|
|
|
|
member ro that
|
|
|
|
type 1 basic UInt
|
2022-10-19 03:39:07 +00:00
|
|
|
uintLiteral 5
|
2022-10-13 06:26:05 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.fInheritObjectFromOther
|
|
|
|
type 1 basic bBird
|
|
|
|
member ro wing
|
|
|
|
type 1 basic Int
|
2022-10-19 03:39:07 +00:00
|
|
|
uintLiteral 2
|
2022-10-13 06:26:05 +00:00
|
|
|
member ro beak
|
|
|
|
type 1 basic Int
|
2022-10-19 03:39:07 +00:00
|
|
|
uintLiteral 238
|
2022-10-18 19:00:42 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.gPointer
|
2022-10-18 21:34:37 +00:00
|
|
|
type 1 pointer {
|
|
|
|
type 1 basic Int
|
|
|
|
}
|
2022-10-18 19:00:42 +00:00
|
|
|
typeSection ro ../tests/analyzer/typeSection.hDynamicArray
|
2022-10-18 21:34:37 +00:00
|
|
|
type 1 dynamicArray {
|
|
|
|
type 1 basic Int
|
|
|
|
}
|
2022-09-18 06:41:06 +00:00
|
|
|
`, test)
|
|
|
|
}
|