Skip to content

Commit 9167f26

Browse files
committed
Improve diff detection
1 parent e373f12 commit 9167f26

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

lib/elixir/scripts/diff.exs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ defmodule Diff do
2020
labeled_locals
2121
)a
2222

23+
@term_chunks ~w(
24+
ExCk
25+
Docs
26+
)c
27+
2328
@binary_chunks ~w(
2429
Attr
2530
AtU8
2631
CInf
2732
Dbgi
28-
Docs
29-
ExCk
3033
ExpT
3134
ImpT
3235
LocT
@@ -95,8 +98,13 @@ defmodule Diff do
9598
end
9699
end
97100

101+
defp inspect_all(data) do
102+
inspect(data, pretty: true, limit: :infinity)
103+
end
104+
98105
defp beam_diff(file1, content1, file2, content2) do
99-
chunk_diff(content1, content2, @atom_chunks, &inspect(&1, pretty: true, limit: :infinity)) ||
106+
chunk_diff(content1, content2, @atom_chunks, &inspect_all(&1)) ||
107+
chunk_diff(content1, content2, @term_chunks, &inspect_all(:erlang.binary_to_term(&1))) ||
100108
chunk_diff(content1, content2, @binary_chunks, &(&1 |> write_tmp() |> xxd_dump())) ||
101109
(
102110
tmp_file1 =

0 commit comments

Comments
 (0)