Skip to content

Commit

Permalink
tests: add unit test with equality check for local pids
Browse files Browse the repository at this point in the history
  • Loading branch information
hengermax committed May 28, 2024
1 parent 460180f commit 7e89d9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rustler_tests/test/local_pid_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ defmodule RustlerTest.LocalPidTest do
test "local pid comparison" do
# We make sure that the code we have in rust code matches the comparisons
# that are performed in the BEAM code.
pids = Enum.sort(for _ <- 1..3, do: make_pid())
pids = for _ <- 1..3, do: make_pid()

for lhs <- pids, rhs <- pids do
assert RustlerTest.compare_local_pids(lhs, rhs) == compare(lhs, rhs)
end
end

test "local pid equality" do
pids = for _ <- 1..3, do: make_pid()

for lhs <- pids, rhs <- pids do
expected = lhs == rhs
assert RustlerTest.are_equal_local_pids(lhs, rhs) == expected
end
end
end

0 comments on commit 7e89d9e

Please sign in to comment.