2019-04-09 11:52:21 -04:00
|
|
|
package ast
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestWarnUnusedResultAttr(t *testing.T) {
|
2019-06-04 00:14:04 -04:00
|
|
|
nodes := map[string]testNode{
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x7fa1d704d420 <col:60> warn_unused_result`: testNode{&WarnUnusedResultAttr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x7fa1d704d420,
|
|
|
|
Pos: NewPositionFromString("col:60"),
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x7fa1d704d420,
|
|
|
|
NewPositionFromString("col:60"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x1fac810 <line:481:52>`: testNode{&WarnUnusedResultAttr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x1fac810,
|
|
|
|
Pos: NewPositionFromString("line:481:52"),
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x1fac810,
|
|
|
|
NewPositionFromString("line:481:52"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-04-09 11:52:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
runNodeTests(t, nodes)
|
|
|
|
}
|