unwrap: Add test for HALT state with an empty stack
Missing piece for perfect coverage. Check that an error is returned an no panic occurs. Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
This commit is contained in:
parent
4b7b71ce25
commit
78050e8b2c
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,12 @@ func TestStdErrors(t *testing.T) {
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
t.Run("HALT state with empty stack", func(t *testing.T) {
|
||||||
|
for _, f := range funcs {
|
||||||
|
_, err := f(&result.Invoke{State: "HALT"}, nil)
|
||||||
|
require.Error(t, err)
|
||||||
|
}
|
||||||
|
})
|
||||||
t.Run("multiple return values", func(t *testing.T) {
|
t.Run("multiple return values", func(t *testing.T) {
|
||||||
for _, f := range funcs {
|
for _, f := range funcs {
|
||||||
_, err := f(&result.Invoke{State: "HALT", Stack: []stackitem.Item{stackitem.Make(42), stackitem.Make(42)}}, nil)
|
_, err := f(&result.Invoke{State: "HALT", Stack: []stackitem.Item{stackitem.Make(42), stackitem.Make(42)}}, nil)
|
||||||
|
|
Loading…
Reference in a new issue