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

     1  package ast
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestArraySubscriptExpr(t *testing.T) {
     8  	nodes := map[string]Node{
     9  		`0x7fe35b85d180 <col:63, col:69> 'char *' lvalue`: &ArraySubscriptExpr{
    10  			Addr:       0x7fe35b85d180,
    11  			Pos:        NewPositionFromString("col:63, col:69"),
    12  			Type:       "char *",
    13  			Type2:      "",
    14  			IsLvalue:   true,
    15  			ChildNodes: []Node{},
    16  		},
    17  		`0x2416660 <col:2, col:5> 'u32':'unsigned int' lvalue`: &ArraySubscriptExpr{
    18  			Addr:       0x2416660,
    19  			Pos:        NewPositionFromString("col:2, col:5"),
    20  			Type:       "u32",
    21  			Type2:      "unsigned int",
    22  			IsLvalue:   true,
    23  			ChildNodes: []Node{},
    24  		},
    25  		`0x3f147c0 <col:39, col:55> 'extCoord':'extCoord' lvalue`: &ArraySubscriptExpr{
    26  			Addr:       0x3f147c0,
    27  			Pos:        NewPositionFromString("col:39, col:55"),
    28  			Type:       "extCoord",
    29  			Type2:      "extCoord",
    30  			IsLvalue:   true,
    31  			ChildNodes: []Node{},
    32  		},
    33  	}
    34  
    35  	runNodeTests(t, nodes)
    36  }