31 lines
509 B
Go
31 lines
509 B
Go
|
package node_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/z7zmey/php-parser/meta"
|
||
|
|
||
|
"github.com/z7zmey/php-parser/node"
|
||
|
)
|
||
|
|
||
|
var nodes = []node.Node{
|
||
|
&node.ArgumentList{},
|
||
|
&node.Argument{},
|
||
|
&node.Identifier{},
|
||
|
&node.Nullable{},
|
||
|
&node.Parameter{},
|
||
|
&node.Root{},
|
||
|
}
|
||
|
|
||
|
func TestMeta(t *testing.T) {
|
||
|
expected := []meta.Meta{
|
||
|
meta.NewComment("//comment\n", nil),
|
||
|
meta.NewWhiteSpace(" ", nil),
|
||
|
}
|
||
|
for _, n := range nodes {
|
||
|
n.AddMeta(expected)
|
||
|
actual := n.GetMeta()
|
||
|
assertEqual(t, expected, actual)
|
||
|
}
|
||
|
}
|