prototmpl_test.go 380 B

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