Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalcooper committed Oct 27, 2024
1 parent a5db0d0 commit 548f8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kinda_example/test/kinda_example_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule KindaExampleTest do
|> KindaExample.Native.to_term()

assert match?(
%Kinda.CallError{message: :failToFetchArgumentResource, error_return_trace: _},
%Kinda.CallError{message: "Fail to fetch argument #2", error_return_trace: _},
catch_error(KindaExample.NIF.kinda_example_add(1, "2"))
)
end
Expand All @@ -34,7 +34,7 @@ defmodule KindaExampleTest do
assert txt =~ "to see the full stack trace, set KINDA_DUMP_STACK_TRACE=1"
end

assert match?(%Kinda.CallError{message: :FunctionClauseError, error_return_trace: _}, err)
assert match?(%Kinda.CallError{message: "FunctionClauseError", error_return_trace: _}, err)

assert KindaExample.NIF."Elixir.KindaExample.NIF.StrInt.make"("1")
|> KindaExample.NIF."Elixir.KindaExample.NIF.CInt.primitive"() ==
Expand Down
2 changes: 1 addition & 1 deletion src/beam.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ fn writeStackTraceToBuffer(
}

pub fn make_exception(env_: env, exception_module: []const u8, err: anyerror, error_trace: ?*std.builtin.StackTrace) term {
const erl_err = make_atom(env_, @errorName(err));
const erl_err = make_slice(env_, @errorName(err));
if (error_trace) |trace| {
var stack_trace = make_nil(env_);
if (std.posix.getenv("KINDA_DUMP_STACK_TRACE")) |KINDA_DUMP_STACK_TRACE| {
Expand Down

0 comments on commit 548f8a0

Please sign in to comment.