We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11c2368 commit 5c0785eCopy full SHA for 5c0785e
lib/ex_unit/lib/ex_unit/doc_test.ex
@@ -604,9 +604,11 @@ defmodule ExUnit.DocTest do
604
defp error_message_matches?(actual, expected) when actual == expected, do: true
605
606
defp error_message_matches?(actual, expected) do
607
- case String.replace_suffix(expected, "...", "") do
608
- ^expected -> false
609
- ellipsis_removed -> String.starts_with?(actual, ellipsis_removed)
+ if String.ends_with?(expected, "...") do
+ ellipsis_removed = binary_slice(expected, 0..-4//1)
+ String.starts_with?(actual, ellipsis_removed)
610
+ else
611
+ false
612
end
613
614
0 commit comments