Skip to content

Commit 7d0eab8

Browse files
committed
test: update with new panic error
1 parent 115d4be commit 7d0eab8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

engine/builtin_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func TestCall(t *testing.T) {
3333
panic("told you")
3434
})
3535
})
36+
vm.Register0(NewAtom("do_not_call_wrapped"), func(*VM, Cont, *Env) *Promise {
37+
panic(errors.New("told you"))
38+
})
3639
assert.NoError(t, vm.Compile(context.Background(), `
3740
foo.
3841
foo(_, _).
@@ -60,8 +63,9 @@ f(g([a, [b, c|X]])).
6063

6164
{title: `cover all`, goal: atomComma.Apply(atomCut, NewAtom("f").Apply(NewAtom("g").Apply(List(NewAtom("a"), PartialList(NewVariable(), NewAtom("b"), NewAtom("c")))))), ok: true},
6265
{title: `out of memory`, goal: NewAtom("foo").Apply(NewVariable(), NewVariable(), NewVariable(), NewVariable(), NewVariable(), NewVariable(), NewVariable(), NewVariable(), NewVariable()), err: resourceError(resourceMemory, nil), mem: 1},
63-
{title: `panic`, goal: NewAtom("do_not_call"), err: errors.New("panic: told you")},
64-
{title: `panic (lazy)`, goal: NewAtom("lazy_do_not_call"), err: errors.New("panic: told you")},
66+
{title: `panic`, goal: NewAtom("do_not_call"), err: PanicError{errors.New("told you")}},
67+
{title: `panic (lazy)`, goal: NewAtom("lazy_do_not_call"), err: PanicError{errors.New("told you")}},
68+
{title: `panic (wrapped)`, goal: NewAtom("do_not_call_wrapped"), err: PanicError{errors.New("told you")}},
6569
}
6670

6771
for _, tt := range tests {

0 commit comments

Comments
 (0)