first commit

This commit is contained in:
Adrian Zürcher
2025-12-18 14:58:06 +01:00
commit 3f14bcfb36
3 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package test
import (
"testing"
templatebuilder "gitea.tecamino.com/paadi/template-builder.git"
)
type Inventory struct {
Material string
Count uint
}
func TestTemplateBuilder(t *testing.T) {
sweaters := Inventory{"wool", 17}
t.Log("start test")
tmplBuilder := templatebuilder.NewTemplateBuilder()
err := tmplBuilder.Generate("test.tmpl", "test.txt", sweaters)
if err != nil {
t.Fatal(err)
}
}

2
test/test.tmpl Normal file
View File

@@ -0,0 +1,2 @@
Material: {{.Material}}
Count: {{.Count}}

2
test/test.txt Normal file
View File

@@ -0,0 +1,2 @@
Material: wool
Count: 17