fix: detect equal lists for node equality

This commit is contained in:
Zach Daniel 2024-08-26 16:53:48 -04:00
parent 678ff157ce
commit 077f8517db

View file

@ -721,7 +721,7 @@ defmodule Igniter.Code.Common do
extendable_block?(left) ->
case left do
{:__block__, _, [left]} ->
equal_vals?(left, right)
nodes_equal?(left, right)
_ ->
false
@ -730,12 +730,16 @@ defmodule Igniter.Code.Common do
extendable_block?(right) ->
case right do
{:__block__, _, [right]} ->
equal_vals?(left, right)
nodes_equal?(left, right)
_ ->
false
end
is_list(left) and is_list(right) ->
length(left) == length(right) and
Enum.all?(Enum.zip(left, right), fn {l, r} -> nodes_equal?(l, r) end)
true ->
false
end