From eb3dbe0a7cd9bdac15d3f298b1e23a050970bf6d Mon Sep 17 00:00:00 2001 From: fall simply Date: Mon, 16 Mar 2020 12:00:40 -0500 Subject: [PATCH] Update Test Examples --- bilet_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bilet_test.go b/bilet_test.go index b51cbc6..4c77275 100644 --- a/bilet_test.go +++ b/bilet_test.go @@ -29,7 +29,7 @@ func TestPopulate(t *testing.T) { } } -func ExamplePopulate() { +func ExampleTmpl_Populate() { Debug = true tmpl := Template("Hello, I'm {{name}} from ${City}, {{from_state}}") str := tmpl.Populate(map[string]string{ @@ -41,6 +41,14 @@ func ExamplePopulate() { // Output: Hello, I'm John from Dallas, TX } +func ExampleTmpl_Pull() { + Debug = true + tmpl := Template("Hello, I'm {{name}} from ${City}, {{from_state}}") + str := tmpl.Pull("Hello, I'm John from Dallas, TX") + fmt.Print(str) + // Output: map[City:Dallas from_state:TX name:John] +} + func TestMakePullRegex(t *testing.T) { Debug = true fmt.Println(testTemplate.template)