github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/ast/if_stmt_test.go (about) 1 package ast 2 3 import ( 4 "testing" 5 ) 6 7 func TestIfStmt(t *testing.T) { 8 nodes := map[string]Node{ 9 `0x7fc0a69091d0 <line:11:7, line:18:7>`: &IfStmt{ 10 Addr: 0x7fc0a69091d0, 11 Pos: NewPositionFromString("line:11:7, line:18:7"), 12 ChildNodes: []Node{}, 13 }, 14 `0x25a5f78 <line:1329:8, line:1337:26> has_else`: &IfStmt{ 15 Addr: 0x25a5f78, 16 Pos: NewPositionFromString("line:1329:8, line:1337:26"), 17 HasElse: true, 18 ChildNodes: []Node{}, 19 }, 20 } 21 22 runNodeTests(t, nodes) 23 }