package ast import ( "testing" ) func TestConstantExpr(t *testing.T) { nodes := map[string]testNode{ `0x7f9bf3033240 'int'`: testNode{&ConstantExpr{ Addr: 0x7f9bf3033240, Pos: NewPositionFromString("col:11, col:25"), Type: "int", ChildNodes: []Node{}, }, 0x7f9bf3033240, NewPositionFromString("col:11, col:25"), []Node{}, }, `0x7f9bf3035c20 'int'`: testNode{&ConstantExpr{ Addr: 0x7f9bf3035c20, Pos: NewPositionFromString("line:7:4, col:64"), Type: "int", ChildNodes: []Node{}, }, 0x7f9bf3035c20, NewPositionFromString("line:7:4, col:64"), []Node{}, }, `0x7f9bf3035c20 'unsigned int'`: testNode{&ConstantExpr{ Addr: 0x7f9bf3035c20, Pos: NewPositionFromString("line:7:4, col:64"), Type: "unsigned int", ChildNodes: []Node{}, }, 0x7f9bf3035c20, NewPositionFromString("line:7:4, col:64"), []Node{}, }, `0x7f9bf3035c20 'NSModalResponse':'long' Int: 1`: testNode{&ConstantExpr{ Addr: 0x7f9bf3035c20, Pos: NewPositionFromString("line:7:4, col:64"), Type: "NSModalResponse", Type2: "long", ChildNodes: []Node{}, }, 0x7f9bf3035c20, NewPositionFromString("line:7:4, col:64"), []Node{}, }, `0x7f9bf3035c20 'NSModalResponse':'unsigned long' Int: 1`: testNode{&ConstantExpr{ Addr: 0x7f9bf3035c20, Pos: NewPositionFromString("line:7:4, col:64"), Type: "NSModalResponse", Type2: "unsigned long", ChildNodes: []Node{}, }, 0x7f9bf3035c20, NewPositionFromString("line:7:4, col:64"), []Node{}, }, } runNodeTests(t, nodes) }