Skip to content

Commit 006ffdc

Browse files
committed
test(s012): the wrong event shape is built at runtime; credo in CI refused apply/3 and the type checker refused the literal
Signed-off-by: Ayla Croft <aylacroft@proton.me>
1 parent 84a7700 commit 006ffdc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎test/trinity/sessions/units_test.exs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ defmodule Trinity.Sessions.UnitsTest do
117117

118118
refute Events.valid?({:assistant_delta, 1})
119119
refute Events.valid?({:chunk, "x"})
120-
# apply/3 keeps the type checker from refusing the deliberately wrong shape at compile time.
121-
assert_raise ArgumentError, fn -> apply(Events, :broadcast, ["s", {:chunk, "x"}]) end
120+
121+
# Built at runtime so the type checker cannot refuse the deliberately wrong shape at compile time.
122+
wrong = List.to_tuple([:chunk, "x"])
123+
assert_raise ArgumentError, fn -> Events.broadcast("s", wrong) end
122124
end
123125
end
124126
end

0 commit comments

Comments
 (0)