Closed seeekr closed 5 years ago
... and just installed elixir 1.8.2-otp-22 via asdf, verified that the occur indeed does not occur there.
The snippet above works for me on Elixir v1.9.1 as long as the module attribute@uid
is set. If it isn't set, then indeed it fails, but it also shows a warning. I didn't check if an unset @uid
module attribute worked on v1.8 but I would argue that failing is the correct behaviour, as we need to call String.Chars on any non-binary interpolated value. Thanks for the report!
@josevalim Ok, but @uid
is clearly defined in the module that contains the test
definition:
@uid 347435
The compiler is also not printing any warnings about it not being defined. If I remove that line, then it does print the warning you mention.
Am I doing something wrong here?
EDIT: And if I do replace that interpolation of @uid
with a plain string, then the failure goes away on v1.9.1.
@seeekr can you please provide a small app or a failing test case that reproduces the error then? I could not reproduce it with v1.9.1. Thanks!
Ok, will do!
@josevalim Here you go: https://github.com/seeekr/phoenixframework_3473
@seeekr your @arg
is an integer. Everything that is not a binary needs to invoke the protocol for conversion. If it works in the past, it was a bug where the protocol was being bypassed. :) Changing it to @arg "123"
works.
@josevalim Hmm, OK, I could understand that. Just 2 things:
1) We should create an issue that tracks improving the resulting error message, because it's not helpful at all. Right?
2) Even with @arg "123"
I get an error like this:
(EDIT to add: Same error message 3 times, once per each test method.)
What else am I doing wrong?
✗ elixir -v
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Elixir 1.9.1 (compiled with Erlang/OTP 20)
Even with @arg "123" I get an error like this:
you are matching on %{socket: socket}
on each test but there is no :socket
key in the test data. You are missing it from your setup.
And I am already working on a better error message for the interpolation one ;)
Even with @arg "123" I get an error like this:
you are matching on
%{socket: socket}
on each test but there is no:socket
key in the test data. You are missing it from your setup.
Thanks, my bad. Apparently I managed to remove the setup
call from the generated test code.
Started working again on a project that I last touched on Elixir 1.8. Now on 1.9, when I try to run
mix test
my channel tests won't compile & run any more:Test looks roughly like this:
The offending line #17 is the one with the assert_push. I don't have any special setup going.
What's going wrong here?
Environment
Elixir 1.9.0 (compiled with Erlang/OTP 22)