Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ex_unit/lib/ex_unit/diff.ex
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,8 @@ defmodule ExUnit.Diff do
end

defp rebuild_split_strings(%{contents: contents, delimiter: delimiter}, right) do
%{contents: contents ++ [{false, right}], delimiter: delimiter}
{new_right, diff} = extract_diff_meta(right)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{:__block__, [diff: true], ["beautifu world"]} gets unpacked as {"beautifu world", true}

%{contents: contents ++ [{diff, new_right}], delimiter: delimiter}
end

defp rebuild_concat_string(literal, nil, []) do
Expand Down
6 changes: 6 additions & 0 deletions lib/ex_unit/test/ex_unit/diff_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,12 @@ defmodule ExUnit.DiffTest do
"-<<trap::binary-size(3)>> <> \"baz\"-",
"+\"foobar\"+"
)

refute_diff(
"hello " <> <<_::binary-size(6)>> = "hello world",
"\"hello \" <> -<<_::binary-size(6)>>-",
"\"hello +world+\""
)
end

test "underscore" do
Expand Down
Loading