nswrap/ast/unused_attr_test.go
2019-06-11 12:38:22 -04:00

33 lines
649 B
Go

package ast
import (
"testing"
)
func TestUnusedAttr(t *testing.T) {
nodes := map[string]testNode{
`0x7fe3e01416d0 <col:47> unused`: testNode{&UnusedAttr{
Addr: 0x7fe3e01416d0,
Pos: NewPositionFromString("col:47"),
ChildNodes: []Node{},
IsUnused: true,
},
0x7fe3e01416d0,
NewPositionFromString("col:47"),
[]Node{},
},
`0x7fe3e01416d0 <col:47>`: testNode{&UnusedAttr{
Addr: 0x7fe3e01416d0,
Pos: NewPositionFromString("col:47"),
ChildNodes: []Node{},
IsUnused: false,
},
0x7fe3e01416d0,
NewPositionFromString("col:47"),
[]Node{},
},
}
runNodeTests(t, nodes)
}