From effecf8007507ee2e90e5462ff6ef7dbc8871d3f Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 16 Feb 2019 00:36:18 -0500 Subject: New functions strings.CamelCase and strings.SnakeCase Signed-off-by: Dave Henderson --- tests/integration/strings_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/integration/strings_test.go b/tests/integration/strings_test.go index affd8f32..4b9db835 100644 --- a/tests/integration/strings_test.go +++ b/tests/integration/strings_test.go @@ -49,3 +49,14 @@ func (s *StringsSuite) TestSlug(c *C) { `{{ strings.Slug "Hellö, Wôrld! Free @ last..." }}`) result.Assert(c, icmd.Expected{ExitCode: 0, Out: `hello-world-free-at-last`}) } + +func (s *StringsSuite) TestCaseFuncs(c *C) { + result := icmd.RunCommand(GomplateBin, "-i", + `{{ strings.CamelCase "Hellö, Wôrld! Free @ last..." }} +{{ strings.SnakeCase "Hellö, Wôrld! Free @ last..." }} +{{ strings.KebabCase "Hellö, Wôrld! Free @ last..." }}`) + result.Assert(c, icmd.Expected{ExitCode: 0, Out: `HellöWôrldFreeLast +Hellö_wôrld_free_last +Hellö-wôrld-free-last`}) + +} -- cgit v1.2.3