From 421df0b7b70e046140ce4b80bbd48e9e9346de1b Mon Sep 17 00:00:00 2001 From: 42Atomys Date: Thu, 9 May 2024 19:59:42 +0200 Subject: [PATCH] test: tooctal function in error state --- conversion_functions_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conversion_functions_test.go b/conversion_functions_test.go index 6069de8..2a103b0 100644 --- a/conversion_functions_test.go +++ b/conversion_functions_test.go @@ -41,11 +41,12 @@ func TestToFloat64(t *testing.T) { runTestCases(t, tests) } -func TestToDecimal(t *testing.T) { +func TestToOctal(t *testing.T) { var tests = testCases{ - {"TestInt", `{{$v := toDecimal .V }}{{typeOf $v}}-{{$v}}`, "int64-511", map[string]any{"V": 777}}, - {"TestInt32", `{{$v := toDecimal .V }}{{typeOf $v}}-{{$v}}`, "int64-504", map[string]any{"V": int32(770)}}, - {"TestString", `{{$v := toDecimal .V }}{{typeOf $v}}-{{$v}}`, "int64-1", map[string]any{"V": "1"}}, + {"TestInt", `{{$v := toOctal .V }}{{typeOf $v}}-{{$v}}`, "int64-511", map[string]any{"V": 777}}, + {"TestInt32", `{{$v := toOctal .V }}{{typeOf $v}}-{{$v}}`, "int64-504", map[string]any{"V": int32(770)}}, + {"TestString", `{{$v := toOctal .V }}{{typeOf $v}}-{{$v}}`, "int64-1", map[string]any{"V": "1"}}, + {"TestInvalid", `{{$v := toOctal .V }}{{typeOf $v}}-{{$v}}`, "int64-0", map[string]any{"V": 1.1}}, } runTestCases(t, tests)