From 3f14bcfb36a9d5aee6f311c7f106905acde8ed26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Z=C3=BCrcher?= Date: Thu, 18 Dec 2025 14:58:06 +0100 Subject: [PATCH] first commit --- test/templateBuilder_test.go | 23 +++++++++++++++++++++++ test/test.tmpl | 2 ++ test/test.txt | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 test/templateBuilder_test.go create mode 100644 test/test.tmpl create mode 100644 test/test.txt 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