Skip to content

Commit dc69977

Browse files
committed
Add a test to ensure literals are not assigned to variables in in/2
1 parent cd68d64 commit dc69977

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/elixir/test/elixir/kernel_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ defmodule KernelTest do
770770

771771
assert expand_to_string(quote(do: foo in 1..1)) ==
772772
":erlang.\"=:=\"(foo, 1)"
773+
774+
assert expand_to_string(quote(do: 2 in 1..3)) ==
775+
":erlang.andalso(:erlang.is_integer(2), :erlang.andalso(:erlang.>=(2, 1), :erlang.\"=<\"(2, 3)))"
773776
end
774777

775778
defp expand_to_string(ast, environment_or_context \\ __ENV__)

0 commit comments

Comments
 (0)