From a22a7177e33c9838a57faea25a3eb4a3b432a916 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 23 Jan 2024 16:06:14 +0300 Subject: [PATCH] smartcontract: improve TestParameterFromValue Run error cases in the same loop with test cases. No functional changes. Signed-off-by: Anna Shaleva --- pkg/smartcontract/parameter_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/smartcontract/parameter_test.go b/pkg/smartcontract/parameter_test.go index a4353a50f..1413b246e 100644 --- a/pkg/smartcontract/parameter_test.go +++ b/pkg/smartcontract/parameter_test.go @@ -785,6 +785,14 @@ func TestParameterFromValue(t *testing.T) { value: testConvertible{err: "invalid i value"}, err: "invalid i value", }, + { + value: make(map[string]int), + err: "unsupported parameter map[string]int", + }, + { + value: []any{1, 2, make(map[string]int)}, + err: "unsupported parameter map[string]int", + }, } for _, item := range items { @@ -800,10 +808,6 @@ func TestParameterFromValue(t *testing.T) { } }) } - _, err := NewParameterFromValue(make(map[string]int)) - require.Error(t, err) - _, err = NewParameterFromValue([]any{1, 2, make(map[string]int)}) - require.Error(t, err) } func TestParametersFromValues(t *testing.T) {