nswrap/ast/c_style_cast_expr_test.go

36 lines
825 B
Go
Raw Normal View History

2019-04-09 11:52:21 -04:00
package ast
import (
"testing"
)
func TestCStyleCastExpr(t *testing.T) {
2019-06-04 00:14:04 -04:00
nodes := map[string]testNode{
`0x7fddc18fb2e0 <col:50, col:56> 'char' <IntegralCast>`: testNode{&CStyleCastExpr{
2019-04-09 11:52:21 -04:00
Addr: 0x7fddc18fb2e0,
Pos: NewPositionFromString("col:50, col:56"),
Type: "char",
Kind: "IntegralCast",
ChildNodes: []Node{},
},
0x7fddc18fb2e0,
NewPositionFromString("col:50, col:56"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0x2781518 <col:7, col:17> 'T_ENUM':'T_ENUM' <IntegralCast>`: testNode{&CStyleCastExpr{
2019-04-09 11:52:21 -04:00
Addr: 0x2781518,
Pos: NewPositionFromString("col:7, col:17"),
Type: "T_ENUM",
2019-05-31 10:21:04 -04:00
Type2: "",
2019-04-09 11:52:21 -04:00
Kind: "IntegralCast",
ChildNodes: []Node{},
},
0x2781518,
NewPositionFromString("col:7, col:17"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
2019-04-09 11:52:21 -04:00
}
runNodeTests(t, nodes)
}