v0.0.294 migrate bfcodegen to templates
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 58s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 58s
This commit is contained in:
@@ -2,6 +2,7 @@ package bfcodegen
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/cmdext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/tst"
|
||||
@@ -12,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
//go:embed _test_example.tgz
|
||||
var ExampleModels []byte
|
||||
var EnumExampleModels []byte
|
||||
|
||||
func TestGenerateEnumSpecs(t *testing.T) {
|
||||
|
||||
@@ -20,7 +21,7 @@ func TestGenerateEnumSpecs(t *testing.T) {
|
||||
|
||||
tmpDir := filepath.Join(t.TempDir(), langext.MustHexUUID())
|
||||
|
||||
err := os.WriteFile(tmpFile, ExampleModels, 0o777)
|
||||
err := os.WriteFile(tmpFile, EnumExampleModels, 0o777)
|
||||
tst.AssertNoErr(t, err)
|
||||
|
||||
t.Cleanup(func() { _ = os.Remove(tmpFile) })
|
||||
@@ -39,4 +40,13 @@ func TestGenerateEnumSpecs(t *testing.T) {
|
||||
err = GenerateEnumSpecs(tmpDir, tmpDir+"/enums_gen.go")
|
||||
tst.AssertNoErr(t, err)
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
fmt.Println("=====================================================================================================")
|
||||
fmt.Println(string(tst.Must(os.ReadFile(tmpDir + "/enums_gen.go"))(t)))
|
||||
fmt.Println("=====================================================================================================")
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
}
|
||||
|
Reference in New Issue
Block a user