summaryrefslogtreecommitdiff
path: root/lib/elixir/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@dashbit.co>2022-12-10 19:27:24 +0100
committerJosé Valim <jose.valim@dashbit.co>2022-12-10 19:27:26 +0100
commit3186819506869a111869f53adfecbe1fcfb8bff8 (patch)
tree00b1a9da311cbe9c798b4087e1d7ab046f0b53ee /lib/elixir/test
parent990367a037fa599c89afa653135cce5e89286b8f (diff)
downloadelixir-3186819506869a111869f53adfecbe1fcfb8bff8.tar.gz
Apply rearrange ops only inside parens, closes #12296
Diffstat (limited to 'lib/elixir/test')
-rw-r--r--lib/elixir/test/elixir/kernel/quote_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/elixir/test/elixir/kernel/quote_test.exs b/lib/elixir/test/elixir/kernel/quote_test.exs
index 894abae55..e3c0ab7b6 100644
--- a/lib/elixir/test/elixir/kernel/quote_test.exs
+++ b/lib/elixir/test/elixir/kernel/quote_test.exs
@@ -328,6 +328,13 @@ defmodule Kernel.QuoteTest do
assert Code.string_to_quoted!("&1 [:foo]") == Code.string_to_quoted!("(&1)[:foo]")
assert Code.string_to_quoted!("& 1[:foo]") == Code.string_to_quoted!("&(1[:foo])")
end
+
+ test "not and ! as rearrange ops" do
+ assert {:__block__, _, [{:not, [line: 1], [true]}]} = Code.string_to_quoted!("(not true)")
+
+ assert {:fn, _, [{:->, _, [[], {:not, _, [true]}]}]} =
+ Code.string_to_quoted!("fn -> not true end")
+ end
end
defmodule Kernel.QuoteTest.Errors do