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{
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x7fe3e01416d0 <col:47> unused`: testNode{&UnusedAttr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x7fe3e01416d0,
|
|
|
|
Pos: NewPositionFromString("col:47"),
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
IsUnused: true,
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x7fe3e01416d0,
|
|
|
|
NewPositionFromString("col:47"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-06-11 12:38:22 -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,
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x7fe3e01416d0,
|
|
|
|
NewPositionFromString("col:47"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-04-09 11:52:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
runNodeTests(t, nodes)
|
|
|
|
}
|