From 8019fb8f08084f88ea95a88354b929b528f55e51 Mon Sep 17 00:00:00 2001 From: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:04:09 +0200 Subject: [PATCH] test: additional use-cases for the expression test --- v2/pkg/protocols/common/expressions/expressions_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v2/pkg/protocols/common/expressions/expressions_test.go b/v2/pkg/protocols/common/expressions/expressions_test.go index 7e4b154a..668b3b45 100644 --- a/v2/pkg/protocols/common/expressions/expressions_test.go +++ b/v2/pkg/protocols/common/expressions/expressions_test.go @@ -18,8 +18,12 @@ func TestEvaluate(t *testing.T) { //{input: "{{hex_encode('{{')}}", expected: "7b7b", extra: map[string]interface{}{}}, //{input: `{{concat("{{", 123, "*", 123, "}}")}}`, expected: "{{123*123}}", extra: map[string]interface{}{}}, //{input: `{{concat("{{", "123*123", "}}")}}`, expected: "{{123*123}}", extra: map[string]interface{}{}}, + //{input: `{{"{{" + '123*123' + "}}"}}`, expected: "{{123*123}}", extra: map[string]interface{}{}}, {input: `{{concat(123,'*',123)}}`, expected: "123*123", extra: map[string]interface{}{}}, {input: `{{1+1}}`, expected: "2", extra: map[string]interface{}{}}, + {input: `{{"1"+"1"}}`, expected: "11", extra: map[string]interface{}{}}, + {input: `{{"1" + '*' + "1"}}`, expected: "1*1", extra: map[string]interface{}{}}, + {input: `{{"a" + 'b' + "c"}}`, expected: "abc", extra: map[string]interface{}{}}, {input: `{{10*2}}`, expected: "20", extra: map[string]interface{}{}}, {input: `{{10/2}}`, expected: "5", extra: map[string]interface{}{}}, {input: `{{10-2}}`, expected: "8", extra: map[string]interface{}{}},