commit 3f14bcfb36a9d5aee6f311c7f106905acde8ed26 Author: Adrian Zürcher Date: Thu Dec 18 14:58:06 2025 +0100 first commit diff --git a/test/templateBuilder_test.go b/test/templateBuilder_test.go new file mode 100644 index 0000000..0ba4ae2 --- /dev/null +++ b/test/templateBuilder_test.go @@ -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) + } +} diff --git a/test/test.tmpl b/test/test.tmpl new file mode 100644 index 0000000..c5d6bbd --- /dev/null +++ b/test/test.tmpl @@ -0,0 +1,2 @@ +Material: {{.Material}} +Count: {{.Count}} \ No newline at end of file diff --git a/test/test.txt b/test/test.txt new file mode 100644 index 0000000..ccf6340 --- /dev/null +++ b/test/test.txt @@ -0,0 +1,2 @@ +Material: wool +Count: 17 \ No newline at end of file