@@ -17,7 +17,7 @@ defmodule Kernel.WarningTest do
1717 def hello(arg), do: nil
1818 end
1919 """
20- end ) =~ "variable arg is unused"
20+ end ) =~ "warning: variable arg is unused"
2121 after
2222 purge Sample
2323 end
@@ -29,7 +29,7 @@ defmodule Kernel.WarningTest do
2929 defp hello, do: nil
3030 end
3131 """
32- end ) =~ "function hello/0 is unused"
32+ end ) =~ "warning: function hello/0 is unused"
3333
3434 assert capture_err ( fn ->
3535 Code . eval_string """
@@ -49,7 +49,7 @@ defmodule Kernel.WarningTest do
4949 defp d(x), do: x
5050 end
5151 """
52- end ) =~ "function c/2 is unused"
52+ end ) =~ "warning: function c/2 is unused"
5353 after
5454 purge [ Sample1 , Sample2 , Sample3 ]
5555 end
@@ -62,7 +62,7 @@ defmodule Kernel.WarningTest do
6262 defp b, do: a
6363 end
6464 """
65- end ) =~ "function a/0 is unused"
65+ end ) =~ "warning: function a/0 is unused"
6666 after
6767 purge Sample
6868 end
@@ -74,7 +74,7 @@ defmodule Kernel.WarningTest do
7474 defmacrop hello, do: nil
7575 end
7676 """
77- end ) =~ "macro hello/0 is unused"
77+ end ) =~ "warning: macro hello/0 is unused"
7878 after
7979 purge Sample
8080 end
@@ -104,7 +104,7 @@ defmodule Kernel.WarningTest do
104104 defp b(arg1 \\ 1, arg2 \\ 2, arg3 \\ 3), do: [arg1, arg2, arg3]
105105 end
106106 """
107- end ) =~ "default arguments in b/3 are never used"
107+ end ) =~ "warning: default arguments in b/3 are never used"
108108
109109 assert capture_err ( fn ->
110110 Code . eval_string % S """
@@ -113,7 +113,7 @@ defmodule Kernel.WarningTest do
113113 defp b(arg1 \\ 1, arg2 \\ 2, arg3 \\ 3), do: [arg1, arg2, arg3]
114114 end
115115 """
116- end ) =~ "the first 2 default arguments in b/3 are never used"
116+ end ) =~ "warning: the first 2 default arguments in b/3 are never used"
117117
118118 assert capture_err ( fn ->
119119 Code . eval_string % S """
@@ -122,7 +122,7 @@ defmodule Kernel.WarningTest do
122122 defp b(arg1 \\ 1, arg2 \\ 2, arg3 \\ 3), do: [arg1, arg2, arg3]
123123 end
124124 """
125- end ) =~ "the first default argument in b/3 is never used"
125+ end ) =~ "warning: the first default argument in b/3 is never used"
126126
127127 assert capture_err ( fn ->
128128 Code . eval_string % S """
@@ -144,13 +144,13 @@ defmodule Kernel.WarningTest do
144144 def a, do: nil
145145 end
146146 """
147- end ) =~ "unused import :lists"
147+ end ) =~ "warning: unused import :lists"
148148
149149 assert capture_err ( fn ->
150150 Code . compile_string """
151151 import :lists, only: [flatten: 1]
152152 """
153- end ) =~ "unused import :lists"
153+ end ) =~ "warning: unused import :lists"
154154 after
155155 purge [ Sample ]
156156 end
@@ -163,7 +163,7 @@ defmodule Kernel.WarningTest do
163163 def a, do: nil
164164 end
165165 """
166- end ) =~ "unused alias List"
166+ end ) =~ "warning: unused alias List"
167167 after
168168 purge [ Sample ]
169169 end
@@ -179,7 +179,7 @@ defmodule Kernel.WarningTest do
179179 flatten ( [ 1 , 2 , 3 ] )
180180 end
181181 end
182- end ) =~ "unused import String"
182+ end ) =~ "warning: unused import String"
183183 after
184184 purge [ Sample ]
185185 end
@@ -197,7 +197,7 @@ defmodule Kernel.WarningTest do
197197 end
198198 end
199199 """
200- end ) =~ "nofile:5: the guard for this clause evaluates to 'false'"
200+ end ) =~ "nofile:5: warning: the guard for this clause evaluates to 'false'"
201201
202202 assert capture_err ( fn ->
203203 Code . eval_string """
@@ -211,7 +211,7 @@ defmodule Kernel.WarningTest do
211211 end
212212 end
213213 """
214- end ) =~ "nofile:6: this clause cannot match because a previous clause at line 5 always matches"
214+ end ) =~ "nofile:6: warning: this clause cannot match because a previous clause at line 5 always matches"
215215 after
216216 purge [ Sample1 , Sample2 ]
217217 end
@@ -224,7 +224,7 @@ defmodule Kernel.WarningTest do
224224 def hello
225225 end
226226 """
227- end ) =~ "empty clause provided for nonexistent function or macro hello/0"
227+ end ) =~ "warning: empty clause provided for nonexistent function or macro hello/0"
228228 after
229229 purge [ Sample1 ]
230230 end
@@ -258,7 +258,7 @@ defmodule Kernel.WarningTest do
258258 def hello, do: nil
259259 end
260260 """
261- end ) =~ "this clause cannot match because a previous clause at line 2 always matches"
261+ end ) =~ "warning: this clause cannot match because a previous clause at line 2 always matches"
262262 after
263263 purge Sample
264264 end
@@ -271,7 +271,7 @@ defmodule Kernel.WarningTest do
271271 def hello(arg \\ 0), do: nil
272272 end
273273 """
274- end ) =~ "clause with defaults should be the first clause in def hello/1"
274+ end ) =~ "warning: clause with defaults should be the first clause in def hello/1"
275275 after
276276 purge Sample
277277 end
@@ -286,7 +286,7 @@ defmodule Kernel.WarningTest do
286286 def hello, do: :ok
287287 end
288288 """
289- end ) =~ "function world/0 is unused"
289+ end ) =~ "warning: function world/0 is unused"
290290 after
291291 purge Sample
292292 end
@@ -312,7 +312,7 @@ defmodule Kernel.WarningTest do
312312 @foo
313313 end
314314 """
315- end ) =~ "undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
315+ end ) =~ "warning: undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
316316 after
317317 purge Sample
318318 end
@@ -326,15 +326,15 @@ defmodule Kernel.WarningTest do
326326 end
327327 end
328328 """
329- end ) =~ "undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
329+ end ) =~ "warning: undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
330330 after
331331 purge Sample
332332 end
333333
334334 test :undefined_module_attribute_with_file do
335335 assert capture_err ( fn ->
336336 Code . load_file ( fixture_path ( "attribute_warning.ex" ) )
337- end ) =~ "attribute_warning.ex:2: AttributeWarning (module) undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
337+ end ) =~ "attribute_warning.ex:2: AttributeWarning (module) warning: undefined module attribute @foo, please remove access to @foo or explicitly set it to nil before access"
338338 after
339339 purge AttributeWarning
340340 end
@@ -346,7 +346,7 @@ defmodule Kernel.WarningTest do
346346 def a(x) when x in [], do: x
347347 end
348348 """
349- end ) =~ "the guard for this clause evaluates to 'false'"
349+ end ) =~ "warning: the guard for this clause evaluates to 'false'"
350350 after
351351 purge Sample
352352 end
@@ -361,7 +361,7 @@ defmodule Kernel.WarningTest do
361361 end
362362 end
363363 """
364- end ) =~ "use of operator != has no effect"
364+ end ) =~ "warning: use of operator != has no effect"
365365 after
366366 purge Sample
367367 end
@@ -378,7 +378,7 @@ defmodule Kernel.WarningTest do
378378 @behaviour Sample1
379379 end
380380 """
381- end ) =~ "undefined behaviour function foo/0 (for behaviour Sample1)"
381+ end ) =~ "warning: undefined behaviour function foo/0 (for behaviour Sample1)"
382382 after
383383 purge [ Sample1 , Sample2 , Sample3 ]
384384 end
@@ -395,7 +395,7 @@ defmodule Kernel.WarningTest do
395395 @behaviour Sample1
396396 end
397397 """
398- end ) =~ "undefined behaviour macro foo/0 (for behaviour Sample1)"
398+ end ) =~ "warning: undefined behaviour macro foo/0 (for behaviour Sample1)"
399399 after
400400 purge [ Sample1 , Sample2 , Sample3 ]
401401 end
@@ -410,7 +410,7 @@ defmodule Kernel.WarningTest do
410410 defimpl Sample1, for: Atom do
411411 end
412412 """
413- end ) =~ "undefined protocol function foo/1 (for protocol Sample1)"
413+ end ) =~ "warning: undefined protocol function foo/1 (for protocol Sample1)"
414414 after
415415 purge [ Sample1 , Sample1.Atom ]
416416 end
@@ -424,7 +424,7 @@ defmodule Kernel.WarningTest do
424424 def foo(x, 2), do: x * 2
425425 end
426426 """
427- end ) =~ "nofile:4: clauses for the same def should be grouped together, def foo/2 was previously defined (nofile:2)"
427+ end ) =~ "nofile:4: warning: clauses for the same def should be grouped together, def foo/2 was previously defined (nofile:2)"
428428 after
429429 purge [ Sample ]
430430 end
@@ -437,7 +437,7 @@ defmodule Kernel.WarningTest do
437437 def foo(x), do: :ok
438438 end
439439 """
440- end ) =~ "sample:3: variable x is unused"
440+ end ) =~ "sample:3: warning: variable x is unused"
441441 after
442442 purge [ Sample ]
443443 end
@@ -452,7 +452,7 @@ defmodule Kernel.WarningTest do
452452 def foo(), do: nil
453453 end
454454 """
455- end ) =~ "nofile:3: type priv/0 is private, @typedoc's are always discarded for private types"
455+ end ) =~ "nofile:3: warning: type priv/0 is private, @typedoc's are always discarded for private types"
456456 after
457457 purge [ Sample ]
458458 end
@@ -464,7 +464,7 @@ defmodule Kernel.WarningTest do
464464 @typedoc "Something"
465465 end
466466 """
467- end ) =~ "nofile:1: @typedoc provided but no type follows it"
467+ end ) =~ "nofile:1: warning: @typedoc provided but no type follows it"
468468 after
469469 purge [ Sample ]
470470 end
0 commit comments