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

     1  package ast
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestParenExpr(t *testing.T) {
     8  	nodes := map[string]Node{
     9  		`0x7fb0bc8b2308 <col:10, col:25> 'unsigned char'`: &ParenExpr{
    10  			Addr:       0x7fb0bc8b2308,
    11  			Pos:        NewPositionFromString("col:10, col:25"),
    12  			Type:       "unsigned char",
    13  			Type2:      "",
    14  			IsLvalue:   false,
    15  			IsBitfield: false,
    16  			ChildNodes: []Node{},
    17  		},
    18  		`0x1ff8708 <col:14, col:17> 'T_ENUM':'T_ENUM' lvalue`: &ParenExpr{
    19  			Addr:       0x1ff8708,
    20  			Pos:        NewPositionFromString("col:14, col:17"),
    21  			Type:       "T_ENUM",
    22  			Type2:      "T_ENUM",
    23  			IsLvalue:   true,
    24  			IsBitfield: false,
    25  			ChildNodes: []Node{},
    26  		},
    27  		`0x55efc60798b0 <col:15, col:27> 'bft':'unsigned int' lvalue bitfield`: &ParenExpr{
    28  			Addr:       0x55efc60798b0,
    29  			Pos:        NewPositionFromString("col:15, col:27"),
    30  			Type:       "bft",
    31  			Type2:      "unsigned int",
    32  			IsLvalue:   true,
    33  			IsBitfield: true,
    34  			ChildNodes: []Node{},
    35  		},
    36  	}
    37  
    38  	runNodeTests(t, nodes)
    39  }