github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/ast/enum_decl_test.go (about)

     1  package ast
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestEnumDecl(t *testing.T) {
     8  	nodes := map[string]Node{
     9  		`0x22a6c80 <line:180:1, line:186:1> __codecvt_result`: &EnumDecl{
    10  			Addr:       0x22a6c80,
    11  			Parent:     0,
    12  			Pos:        NewPositionFromString("line:180:1, line:186:1"),
    13  			Position2:  "",
    14  			Name:       "__codecvt_result",
    15  			ChildNodes: []Node{},
    16  		},
    17  		`0x32fb5a0 <enum.c:3:1, col:45> col:6 week`: &EnumDecl{
    18  			Addr:       0x32fb5a0,
    19  			Parent:     0,
    20  			Pos:        NewPositionFromString("enum.c:3:1, col:45"),
    21  			Position2:  " col:6",
    22  			Name:       "week",
    23  			ChildNodes: []Node{},
    24  		},
    25  		`0x3a0f830 parent 0x392faf0 <line:74:5, line:76:5> line:74:10 EnumTwo`: &EnumDecl{
    26  			Addr:       0x3a0f830,
    27  			Parent:     0x392faf0,
    28  			Pos:        NewPositionFromString("line:74:5, line:76:5"),
    29  			Position2:  " line:74:10",
    30  			Name:       "EnumTwo",
    31  			ChildNodes: []Node{},
    32  		},
    33  		`0x2b002c0 prev 0x2affd78 <line:28:1, line:31:1> line:28:6 efoo`: &EnumDecl{
    34  			Addr:       0x2b002c0,
    35  			Prev:       "0x2affd78",
    36  			Pos:        NewPositionFromString("line:28:1, line:31:1"),
    37  			Position2:  " line:28:6",
    38  			Name:       "efoo",
    39  			ChildNodes: []Node{},
    40  		},
    41  	}
    42  
    43  	runNodeTests(t, nodes)
    44  }