php-parser/comment/comment_test.go
2018-06-26 00:07:02 +03:00

32 lines
576 B
Go

package comment_test
import (
"testing"
"github.com/z7zmey/php-parser/comment"
)
func TestCommentPrint(t *testing.T) {
expected := "/** hello world */"
comment := comment.NewComment(expected, nil)
actual := comment.String()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentSetTokenName(t *testing.T) {
expected := comment.ArrayToken
c := comment.NewComment("/** hello world */", nil)
c.SetTokenName(expected)
actual := c.TokenName
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}