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

     1  package ast
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestFormatAttr(t *testing.T) {
     8  	nodes := map[string]Node{
     9  		`0x7fcc8d8ecee8 <col:6> Implicit printf 2 3`: &FormatAttr{
    10  			Addr:         0x7fcc8d8ecee8,
    11  			Pos:          NewPositionFromString("col:6"),
    12  			IsImplicit:   true,
    13  			IsInherited:  false,
    14  			FunctionName: "printf",
    15  			Unknown1:     2,
    16  			Unknown2:     3,
    17  			ChildNodes:   []Node{},
    18  		},
    19  		`0x7fcc8d8ecff8 </usr/include/sys/cdefs.h:351:18, col:61> printf 2 3`: &FormatAttr{
    20  			Addr:         0x7fcc8d8ecff8,
    21  			Pos:          NewPositionFromString("/usr/include/sys/cdefs.h:351:18, col:61"),
    22  			IsImplicit:   false,
    23  			IsInherited:  false,
    24  			FunctionName: "printf",
    25  			Unknown1:     2,
    26  			Unknown2:     3,
    27  			ChildNodes:   []Node{},
    28  		},
    29  		`0x273b4d0 <line:357:12> Inherited printf 2 3`: &FormatAttr{
    30  			Addr:         0x273b4d0,
    31  			Pos:          NewPositionFromString("line:357:12"),
    32  			IsImplicit:   false,
    33  			IsInherited:  true,
    34  			FunctionName: "printf",
    35  			Unknown1:     2,
    36  			Unknown2:     3,
    37  			ChildNodes:   []Node{},
    38  		},
    39  	}
    40  
    41  	runNodeTests(t, nodes)
    42  }