1
0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-09-20 08:02:57 +00:00
cloudkeys-go/vendor/github.com/flosch/pongo2/pongo2_issues_test.go

30 lines
501 B
Go
Raw Normal View History

2017-12-28 01:56:23 +00:00
package pongo2_test
2015-07-30 15:43:22 +00:00
import (
"testing"
2017-12-28 01:56:23 +00:00
"github.com/flosch/pongo2"
2015-07-30 15:43:22 +00:00
)
2017-12-28 01:56:23 +00:00
func TestIssue151(t *testing.T) {
tpl, err := pongo2.FromString("{{ mydict.51232_3 }}{{ 12345_123}}{{ 995189baz }}")
if err != nil {
t.Fatal(err)
}
2015-07-30 15:43:22 +00:00
2017-12-28 01:56:23 +00:00
str, err := tpl.Execute(pongo2.Context{
"mydict": map[string]string{
"51232_3": "foo",
},
"12345_123": "bar",
"995189baz": "baz",
})
if err != nil {
t.Fatal(err)
}
2015-07-30 15:43:22 +00:00
2017-12-28 01:56:23 +00:00
if str != "foobarbaz" {
t.Fatalf("Expected output 'foobarbaz', but got '%s'.", str)
}
2015-07-30 15:43:22 +00:00
}