From 6f14f57ae4b303e486b689c0c24c376eacd4eabd Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Tue, 31 Oct 2017 10:26:21 -0400 Subject: Add time.ParseLocal function Signed-off-by: Dave Henderson --- test/integration/time.bats | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/integration/time.bats b/test/integration/time.bats index 3d91d2f6..83441f60 100644 --- a/test/integration/time.bats +++ b/test/integration/time.bats @@ -27,6 +27,18 @@ load helper [[ "${output}" == "2009-02-13 23 +0000" ]] } +@test "'(time.ParseLocal).Format'" { + TZ=Africa/Luanda gomplate -i "{{ (time.ParseLocal time.Kitchen \"6:00AM\").Format \"15:04 MST\" }}" + [ "$status" -eq 0 ] + [[ "${output}" == "06:00 LMT" ]] +} + +@test "'(time.ParseInLocation).Format'" { + gomplate -i "{{ (time.ParseInLocation time.Kitchen \"Africa/Luanda\" \"6:00AM\").Format \"15:04 MST\" }}" + [ "$status" -eq 0 ] + [[ "${output}" == "06:00 LMT" ]] +} + @test "'(time.Unix).UTC.Format' int" { gomplate -i '{{ (time.Unix 1234567890).UTC.Format "2006-01-02 15 -0700" }}' [ "$status" -eq 0 ] -- cgit v1.2.3