Skip to content

Commit 1fba8a7

Browse files
committed
Improve non-deterministic chunk detection
1 parent 72c162a commit 1fba8a7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/elixir/scripts/diff.exs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ defmodule Diff do
137137
chunk1 != chunk2 do
138138
tmp_file1 = chunk1 |> formatter.() |> write_tmp()
139139
tmp_file2 = chunk2 |> formatter.() |> write_tmp()
140-
[to_string(name1), ?\n, file_diff(tmp_file1, tmp_file2)]
140+
141+
message =
142+
case file_diff(tmp_file1, tmp_file2) do
143+
"" -> "DIFF IS EMPTY: most likely non-deterministic term_to_binary/2"
144+
diff -> diff
145+
end
146+
147+
[to_string(name1), ?\n, message]
141148
end
142149
end
143150
else

0 commit comments

Comments
 (0)