prototmpl_test.go 399 B

123456789101112131415161718192021
  1. package generator
  2. import (
  3. "path/filepath"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/util/pathx"
  7. )
  8. func TestProtoTmpl(t *testing.T) {
  9. _ = Clean()
  10. // exists dir
  11. err := ProtoTmpl(pathx.MustTempDir())
  12. assert.Nil(t, err)
  13. // not exist dir
  14. dir := filepath.Join(pathx.MustTempDir(), "test")
  15. err = ProtoTmpl(dir)
  16. assert.Nil(t, err)
  17. }