Skip to content

Commit

Permalink
tests: make test_raw_raise pass with AVM_CREATE_STACKTRACES=off
Browse files Browse the repository at this point in the history
When using AVM_CREATE_STACKTRACES=off undefined is used as stacktrace
value, making `test_raw_raise` fail.

Since it is a known behavior also accept it, but this behavior should be
checked and reviewed (e.g. `[]` might be used instead as stack trace
value).

See also #1247

Signed-off-by: Davide Bettio <davide@uninstall.it>
  • Loading branch information
bettio committed Aug 17, 2024
1 parent 2753129 commit 2813ce9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/erlang_tests/test_raw_raise.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ do_catch() ->
_X -> 1
catch
error:{badarith, new_reason}:ST ->
% TODO: verify if undefined is an acceptable value or an AtomVM only extension
% See also issue #1247
case ST of
L when is_list(L) -> 0;
undefined -> 0;
_ -> 2
end;
_:_ ->
Expand Down

0 comments on commit 2813ce9

Please sign in to comment.