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

     1  package ast
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestVisibilityAttr(t *testing.T) {
     8  	nodes := map[string]Node{
     9  		`0x55c49d8dd1d8 <col:16, col:36> Default`: &VisibilityAttr{
    10  			Addr:        0x55c49d8dd1d8,
    11  			Pos:         NewPositionFromString("col:16, col:36"),
    12  			ChildNodes:  []Node{},
    13  			IsInherited: false,
    14  			IsDefault:   true,
    15  			IsHidden:    false,
    16  		},
    17  		`0x7f8e7b00bb80 </cmark/src/cmark.h:497:16, col:36> Inherited Default`: &VisibilityAttr{
    18  			Addr:        0x7f8e7b00bb80,
    19  			Pos:         NewPositionFromString("/cmark/src/cmark.h:497:16, col:36"),
    20  			ChildNodes:  []Node{},
    21  			IsInherited: true,
    22  			IsDefault:   true,
    23  			IsHidden:    false,
    24  		},
    25  		`0x55ab30581650 <line:24:16, col:35> Hidden`: &VisibilityAttr{
    26  			Addr:        0x55ab30581650,
    27  			Pos:         NewPositionFromString("line:24:16, col:35"),
    28  			ChildNodes:  []Node{},
    29  			IsInherited: false,
    30  			IsDefault:   false,
    31  			IsHidden:    true,
    32  		},
    33  		`0x2960578 <line:37:13> Implicit Default`: &VisibilityAttr{
    34  			Addr:        0x2960578,
    35  			Pos:         NewPositionFromString("line:37:13"),
    36  			ChildNodes:  []Node{},
    37  			IsInherited: false,
    38  			IsDefault:   true,
    39  			IsHidden:    false,
    40  			IsImplicit:  true,
    41  		},
    42  	}
    43  
    44  	runNodeTests(t, nodes)
    45  }