nswrap/ast/unused_attr_test.go

33 lines
649 B
Go
Raw Normal View History

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