Skip to content

Commit 1108a6c

Browse files
sabiwarajosevalim
authored andcommitted
Fix more map inspection tests (#12433)
1 parent 32c929b commit 1108a6c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/elixir/test/elixir/exception_test.exs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ defmodule ExceptionTest do
1818
end
1919
end
2020

21-
assert Exception.message(%{__struct__: BadException, __exception__: true, raise: true}) =~
22-
"got RuntimeError with message \"oops\" while retrieving Exception.message/1 " <>
23-
"for %{__exception__: true, __struct__: ExceptionTest.BadException, raise: true}"
21+
assert "got RuntimeError with message \"oops\" while retrieving Exception.message/1 for %{" <>
22+
inspected =
23+
Exception.message(%{__struct__: BadException, __exception__: true, raise: true})
2424

25-
assert Exception.message(%{__struct__: BadException, __exception__: true, raise: false}) =~
26-
"got nil while retrieving Exception.message/1 " <>
27-
"for %{__exception__: true, __struct__: ExceptionTest.BadException, raise: false}"
25+
assert inspected =~ "raise: true"
26+
assert inspected =~ "__exception__: true"
27+
assert inspected =~ "__struct__: ExceptionTest.BadException"
28+
29+
assert "got nil while retrieving Exception.message/1 for %{" <> inspected =
30+
Exception.message(%{__struct__: BadException, __exception__: true, raise: false})
31+
32+
assert inspected =~ "raise: false"
33+
assert inspected =~ "__exception__: true"
34+
assert inspected =~ "__struct__: ExceptionTest.BadException"
2835
end
2936

3037
test "normalize/2" do

0 commit comments

Comments
 (0)