@@ -499,12 +499,14 @@ defmodule Styler.Style.PipesTest do
499
499
end
500
500
501
501
test "rewrites then/2 when the passed function is a named function reference" do
502
- assert_style ( "a |> then(&fun/1) |> c" , "a |> fun() |> c()" )
503
- assert_style ( "a |> then(&DateTime.from_is8601/1) |> c" , "a |> DateTime.from_is8601() |> c()" )
504
- assert_style ( "a |> then(&DateTime.from_is8601/1)" , "DateTime.from_is8601(a)" )
505
- assert_style ( "a |> then(&fun(&1)) |> c" , "a |> fun() |> c()" )
506
- assert_style ( "a |> then(&fun(&1, d)) |> c" , "a |> fun(d) |> c()" )
507
- assert_style ( "a |> then(&fun(d, &1)) |> c" , "a |> then(&fun(d, &1)) |> c()" )
502
+ assert_style "a |> then(&fun/1) |> c" , "a |> fun() |> c()"
503
+ assert_style "a |> then(&DateTime.from_is8601/1) |> c" , "a |> DateTime.from_is8601() |> c()"
504
+ assert_style "a |> then(&DateTime.from_is8601/1)" , "DateTime.from_is8601(a)"
505
+ assert_style "a |> then(&fun(&1)) |> c" , "a |> fun() |> c()"
506
+ assert_style "a |> then(&fun(&1, d)) |> c" , "a |> fun(d) |> c()"
507
+
508
+ assert_style "a |> then(&fun(d, &1)) |> c()"
509
+ assert_style "a |> then(&fun(&1, d, %{foo: &1})) |> c()"
508
510
end
509
511
510
512
test "adds parens to 1-arity pipes" do
0 commit comments