1
0
mirror of https://github.com/beego/bee.git synced 2024-11-15 03:20:54 +00:00
bee/parser/formatter_test.go

34 lines
513 B
Go
Raw Normal View History

2021-05-25 02:53:12 +00:00
package beeParser
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestFormat(t *testing.T) {
except := `{
"Name": [
"Field1"
],
"Path":[
"https://github.com/beego/bee",
"https://github.com/beego"
],
"test":[
"test comment"
]
}`
field := &StructField{
Comment: "@test test comment",
Doc: `@Name Field1
@Path https://github.com/beego/bee
https://github.com/beego`,
}
actual := NewAnnotationFormatter().Format(field)
assert.JSONEq(t, except, actual)
}