Skip to content

Commit

Permalink
tests(Kernel.WarningTest): test for pipeline without parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
Gazler committed Nov 16, 2015
1 parent 3487d00 commit 76178a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/elixir/test/elixir/kernel/warning_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,16 @@ defmodule Kernel.WarningTest do
purge Sample
end

test "pipe without explicit parentheses" do
assert capture_err(fn ->
Code.eval_string """
[5, 6, 7, 3]
|> Enum.map_join "", &(Integer.to_string(&1))
|> String.to_integer
"""
end) =~ "nofile:2: warning: you are piping into a function call without parentheses"
end

defp purge(list) when is_list(list) do
Enum.each list, &purge/1
end
Expand Down

0 comments on commit 76178a6

Please sign in to comment.