nswrap/ast/objc_interface_decl_test.go

49 lines
1.2 KiB
Go
Raw Normal View History

2019-05-31 10:21:04 -04:00
package ast
import (
"testing"
)
func TestObjCInterfaceDecl(t *testing.T) {
2019-06-04 00:14:04 -04:00
nodes := map[string]testNode{
`0x7fdef0862430 <line:120:1, col:16> col:16 NSObject`: testNode{&ObjCInterfaceDecl{
Addr: 0x7fdef0862430,
Pos: NewPositionFromString("line:120:1, col:16"),
Position2: "",
Name: "NSObject",
Implicit: false,
ChildNodes: []Node{},
2019-05-31 10:21:04 -04:00
},
0x7fdef0862430,
NewPositionFromString("line:120:1, col:16"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0x7fdef0862430 prev 0x7fca43341430 <line:120:1, col:16> col:16 NSObject`: testNode{&ObjCInterfaceDecl{
Addr: 0x7fdef0862430,
Pos: NewPositionFromString("line:120:1, col:16"),
Position2: "",
Name: "NSObject",
Implicit: false,
ChildNodes: []Node{},
2019-05-31 10:21:04 -04:00
},
0x7fdef0862430,
NewPositionFromString("line:120:1, col:16"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0x7fdef0862430 <<invalid sloc>> <invalid sloc> implicit Protocol`: testNode{&ObjCInterfaceDecl{
Addr: 0x7fdef0862430,
Pos: Position{},
Position2: "",
Name: "Protocol",
Implicit: true,
ChildNodes: []Node{},
2019-05-31 10:21:04 -04:00
},
0x7fdef0862430,
Position{},
[]Node{},
2019-06-04 00:14:04 -04:00
},
2019-05-31 10:21:04 -04:00
}
runNodeTests(t, nodes)
}