@@ -105,23 +105,36 @@ defmodule String.Chars.ErrorsTest do
105105
106106 test "bitstring" do
107107 message =
108- "protocol String.Chars not implemented for type BitString, cannot convert a bitstring to a string\n \n Got value:\n \n <<0, 1::size(4)>>"
108+ """
109+ protocol String.Chars not implemented for type BitString, cannot convert a bitstring to a string
110+
111+ Got value:
112+
113+ <<0, 1::size(4)>>
114+ """
109115
110116 assert_raise Protocol.UndefinedError , message , fn ->
111117 to_string ( << 1 :: size ( 12 ) - integer - signed >> )
112118 end
113119 end
114120
115121 test "tuple" do
116- message = "protocol String.Chars not implemented for type Tuple\n \n Got value:\n \n {1, 2, 3}"
122+ message = """
123+ protocol String.Chars not implemented for type Tuple
124+
125+ Got value:
126+
127+ {1, 2, 3}
128+ """
117129
118130 assert_raise Protocol.UndefinedError , message , fn ->
119131 to_string ( { 1 , 2 , 3 } )
120132 end
121133 end
122134
123135 test "PID" do
124- message = ~r" ^protocol String\. Chars not implemented for type PID\n \n Got value:\n \n #PID<.+?>$"
136+ message =
137+ ~r" ^protocol String\. Chars not implemented for type PID\n \n Got value:\n \n #PID<.+?>$"
125138
126139 assert_raise Protocol.UndefinedError , message , fn ->
127140 to_string ( self ( ) )
@@ -130,7 +143,7 @@ defmodule String.Chars.ErrorsTest do
130143
131144 test "ref" do
132145 message =
133- ~r" ^protocol String\. Chars not implemented for type Reference\n \n Got value:\n \n #Reference<.+?>$"
146+ ~r" ^protocol String\. Chars not implemented for type Reference\n \n Got value:\n \n #Reference<.+?>$"
134147
135148 assert_raise Protocol.UndefinedError , message , fn ->
136149 to_string ( make_ref ( ) ) == ""
@@ -139,7 +152,7 @@ defmodule String.Chars.ErrorsTest do
139152
140153 test "function" do
141154 message =
142- ~r" ^protocol String\. Chars not implemented for type Function\n \n Got value:\n \n #Function<.+?>$"
155+ ~r" ^protocol String\. Chars not implemented for type Function\n \n Got value:\n \n #Function<.+?>$"
143156
144157 assert_raise Protocol.UndefinedError , message , fn ->
145158 to_string ( fn -> nil end )
@@ -150,7 +163,7 @@ defmodule String.Chars.ErrorsTest do
150163 [ port | _ ] = Port . list ( )
151164
152165 message =
153- ~r" ^protocol String\. Chars not implemented for type Port\n \n Got value:\n \n #Port<.+?>$"
166+ ~r" ^protocol String\. Chars not implemented for type Port\n \n Got value:\n \n #Port<.+?>$"
154167
155168 assert_raise Protocol.UndefinedError , message , fn ->
156169 to_string ( port )
@@ -159,7 +172,7 @@ defmodule String.Chars.ErrorsTest do
159172
160173 test "user-defined struct" do
161174 message =
162- "protocol String\. Chars not implemented for type String.Chars.ErrorsTest.Foo (a struct)\n \n Got value:\n \n %String.Chars.ErrorsTest.Foo{foo: \" bar\" }"
175+ "protocol String\. Chars not implemented for type String.Chars.ErrorsTest.Foo (a struct)\n \n Got value:\n \n %String.Chars.ErrorsTest.Foo{foo: \" bar\" }\n "
163176
164177 assert_raise Protocol.UndefinedError , message , fn ->
165178 to_string ( % Foo { } )
0 commit comments