nswrap/ast/aligned_attr_test.go

35 lines
668 B
Go
Raw Normal View History

2019-04-09 11:52:21 -04:00
package ast
import (
"testing"
)
func TestAlignedAttr(t *testing.T) {
2019-06-04 00:14:04 -04:00
nodes := map[string]testNode{
`0x7f8a1d8ccfd0 <col:47, col:57> aligned`:
testNode{&AlignedAttr{
2019-04-09 11:52:21 -04:00
Addr: 0x7f8a1d8ccfd0,
Pos: NewPositionFromString("col:47, col:57"),
IsAligned: true,
ChildNodes: []Node{},
2019-06-04 00:14:04 -04:00
},
0x7f8a1d8ccfd0,
NewPositionFromString("col:47, col:57"),
[]Node{},
2019-04-09 11:52:21 -04:00
},
2019-06-04 00:14:04 -04:00
`0x2c8ba10 <col:42>`: testNode{ &AlignedAttr{
2019-04-09 11:52:21 -04:00
Addr: 0x2c8ba10,
Pos: NewPositionFromString("col:42"),
IsAligned: false,
ChildNodes: []Node{},
2019-06-04 00:14:04 -04:00
},
0x2c8ba10,
NewPositionFromString("col:42"),
[]Node{},
2019-04-09 11:52:21 -04:00
},
}
runNodeTests(t, nodes)
}
2019-06-04 00:14:04 -04:00