forked from TrueCloudLab/neoneo-go
smartcontract: improve TestParameterFromValue
Run error cases in the same loop with test cases. No functional changes. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
b90c0ece87
commit
a22a7177e3
1 changed files with 8 additions and 4 deletions
|
@ -785,6 +785,14 @@ func TestParameterFromValue(t *testing.T) {
|
||||||
value: testConvertible{err: "invalid i value"},
|
value: testConvertible{err: "invalid i value"},
|
||||||
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 {
|
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) {
|
func TestParametersFromValues(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue