package ast import ( "testing" ) func TestNonNullAttr(t *testing.T) { nodes := map[string]testNode{ `0x7fa1488273b0 1`: testNode{&NonNullAttr{ Addr: 0x7fa1488273b0, Pos: NewPositionFromString("line:7:4, line:11:4"), Inherited: false, A: 1, B: 0, C: 0, D: 0, ChildNodes: []Node{}, }, 0x7fa1488273b0, NewPositionFromString("line:7:4, line:11:4"), []Node{}, }, `0x2cce280 1`: testNode{&NonNullAttr{ Addr: 0x2cce280, Pos: NewPositionFromString("/sys/cdefs.h:286:44, /bits/mathcalls.h:115:69"), Inherited: false, A: 1, B: 0, C: 0, D: 0, ChildNodes: []Node{}, }, 0x2cce280, NewPositionFromString("/sys/cdefs.h:286:44, /bits/mathcalls.h:115:69"), []Node{}, }, `0x201ede0 0`: testNode{&NonNullAttr{ Addr: 0x201ede0, Pos: NewPositionFromString("line:145:79, col:93"), Inherited: false, A: 0, B: 0, C: 0, D: 0, ChildNodes: []Node{}, }, 0x201ede0, NewPositionFromString("line:145:79, col:93"), []Node{}, }, `0x1b89b20 2 3`: testNode{&NonNullAttr{ Addr: 0x1b89b20, Pos: NewPositionFromString("col:76, col:93"), Inherited: false, A: 2, B: 3, C: 0, D: 0, ChildNodes: []Node{}, }, 0x1b89b20, NewPositionFromString("col:76, col:93"), []Node{}, }, `0x55f0219e20d0 0 1 4`: testNode{&NonNullAttr{ Addr: 0x55f0219e20d0, Pos: NewPositionFromString("line:717:22, col:42"), Inherited: false, A: 0, B: 1, C: 4, D: 0, ChildNodes: []Node{}, }, 0x55f0219e20d0, NewPositionFromString("line:717:22, col:42"), []Node{}, }, `0x248ea60 0 1 2 4`: testNode{&NonNullAttr{ Addr: 0x248ea60, Pos: NewPositionFromString("line:155:26, col:49"), Inherited: false, A: 0, B: 1, C: 2, D: 4, ChildNodes: []Node{}, }, 0x248ea60, NewPositionFromString("line:155:26, col:49"), []Node{}, }, `0x39cf2b0 Inherited 0 1`: testNode{&NonNullAttr{ Addr: 0x39cf2b0, Pos: NewPositionFromString("col:53"), Inherited: true, A: 0, B: 1, C: 0, D: 0, ChildNodes: []Node{}, }, 0x39cf2b0, NewPositionFromString("col:53"), []Node{}, }, } runNodeTests(t, nodes) }