github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/ast/non_null_attr_test.go (about) 1 package ast 2 3 import ( 4 "testing" 5 ) 6 7 func TestNonNullAttr(t *testing.T) { 8 nodes := map[string]Node{ 9 `0x7fa1488273b0 <line:7:4, line:11:4> 1`: &NonNullAttr{ 10 Addr: 0x7fa1488273b0, 11 Pos: NewPositionFromString("line:7:4, line:11:4"), 12 IsInherited: false, 13 A: 1, 14 B: 0, 15 C: 0, 16 D: 0, 17 ChildNodes: []Node{}, 18 }, 19 `0x2cce280 </sys/cdefs.h:286:44, /bits/mathcalls.h:115:69> 1`: &NonNullAttr{ 20 Addr: 0x2cce280, 21 Pos: NewPositionFromString("/sys/cdefs.h:286:44, /bits/mathcalls.h:115:69"), 22 IsInherited: false, 23 A: 1, 24 B: 0, 25 C: 0, 26 D: 0, 27 ChildNodes: []Node{}, 28 }, 29 `0x201ede0 <line:145:79, col:93> 0`: &NonNullAttr{ 30 Addr: 0x201ede0, 31 Pos: NewPositionFromString("line:145:79, col:93"), 32 IsInherited: false, 33 A: 0, 34 B: 0, 35 C: 0, 36 D: 0, 37 ChildNodes: []Node{}, 38 }, 39 `0x1b89b20 <col:76, col:93> 2 3`: &NonNullAttr{ 40 Addr: 0x1b89b20, 41 Pos: NewPositionFromString("col:76, col:93"), 42 IsInherited: false, 43 A: 2, 44 B: 3, 45 C: 0, 46 D: 0, 47 ChildNodes: []Node{}, 48 }, 49 `0x55f0219e20d0 <line:717:22, col:42> 0 1 4`: &NonNullAttr{ 50 Addr: 0x55f0219e20d0, 51 Pos: NewPositionFromString("line:717:22, col:42"), 52 IsInherited: false, 53 A: 0, 54 B: 1, 55 C: 4, 56 D: 0, 57 ChildNodes: []Node{}, 58 }, 59 `0x248ea60 <line:155:26, col:49> 0 1 2 4`: &NonNullAttr{ 60 Addr: 0x248ea60, 61 Pos: NewPositionFromString("line:155:26, col:49"), 62 IsInherited: false, 63 A: 0, 64 B: 1, 65 C: 2, 66 D: 4, 67 ChildNodes: []Node{}, 68 }, 69 `0x39cf2b0 <col:53> Inherited 0 1`: &NonNullAttr{ 70 Addr: 0x39cf2b0, 71 Pos: NewPositionFromString("col:53"), 72 IsInherited: true, 73 A: 0, 74 B: 1, 75 C: 0, 76 D: 0, 77 ChildNodes: []Node{}, 78 }, 79 } 80 81 runNodeTests(t, nodes) 82 }