go-zero/tools/goctl/rpc/generator/prototmpl_test.go

22 lines
380 B
Go
Raw Normal View History

package generator
import (
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
2021-09-21 10:13:43 +08:00
"github.com/tal-tech/go-zero/tools/goctl/util"
)
func TestProtoTmpl(t *testing.T) {
_ = Clean()
// exists dir
2021-09-21 10:13:43 +08:00
err := ProtoTmpl(util.MustTempDir())
assert.Nil(t, err)
// not exist dir
2021-09-21 10:13:43 +08:00
dir := filepath.Join(util.MustTempDir(), "test")
err = ProtoTmpl(dir)
assert.Nil(t, err)
}