@@ -54,7 +54,8 @@ defmodule Plug.DebuggerTest do
54
54
55
55
get "/bad_match" do
56
56
_ = conn
57
- bad_match ( :six , :one )
57
+ # Code.eval_quoted/2 to avoid typing violations at compile time.
58
+ Code . eval_quoted ( quote do: unquote ( __MODULE__ ) . bad_match ( :six , :one ) )
58
59
end
59
60
60
61
get "/send_and_wrapped" do
@@ -77,14 +78,18 @@ defmodule Plug.DebuggerTest do
77
78
raise ActionableError
78
79
end
79
80
80
- defp returns_nil , do: nil
81
+ # Code.eval_quoted/2 to avoid typing violations at compile time.
82
+ defp returns_nil do
83
+ { result , _bindings } = Code . eval_quoted ( quote do: nil )
84
+ result
85
+ end
81
86
82
87
defp add_csp ( conn , _opts ) ,
83
88
do: Plug.Conn . put_resp_header ( conn , "content-security-policy" , "abcdef" )
84
89
85
- defp bad_match ( :one , :two ) , do: :ok
86
- defp bad_match ( :three , :four ) , do: :ok
87
- defp bad_match ( :five , :six ) , do: :ok
90
+ def bad_match ( :one , :two ) , do: :ok
91
+ def bad_match ( :three , :four ) , do: :ok
92
+ def bad_match ( :five , :six ) , do: :ok
88
93
end
89
94
90
95
defmodule StyledRouter do
0 commit comments