diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2017-05-06 12:49:39 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2017-05-06 12:58:05 -0400 |
| commit | f358f185e00bf92bf2095b1eebcc4c950588488d (patch) | |
| tree | 48f6def4ef5162c7d9b6da2f9e2fa1d0b58d78d8 /gomplate_test.go | |
| parent | 582a78b12aa119bf7dc46b6722b5423a456bb456 (diff) | |
Fixing bug with 'has' and 'datasource' around referencing sub-maps in nested maps
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'gomplate_test.go')
| -rw-r--r-- | gomplate_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gomplate_test.go b/gomplate_test.go index e35e6660..1d55751b 100644 --- a/gomplate_test.go +++ b/gomplate_test.go @@ -125,8 +125,9 @@ func TestHasTemplate(t *testing.T) { "has": ty.Has, }, } - assert.Equal(t, "true", testTemplate(g, `{{has ("foo: true" | yaml) "foo"}}`)) - assert.Equal(t, "false", testTemplate(g, `{{has ("foo: true" | yaml) "bar"}}`)) + assert.Equal(t, "true", testTemplate(g, `{{has ("foo:\n bar: true" | yaml) "foo"}}`)) + assert.Equal(t, "true", testTemplate(g, `{{has ("foo:\n bar: true" | yaml).foo "bar"}}`)) + assert.Equal(t, "false", testTemplate(g, `{{has ("foo: true" | yaml) "bah"}}`)) tmpl := `{{- $data := yaml "foo: bar\nbaz: qux\n" }} {{- if (has $data "baz") }} {{- $data.baz }} |
