   end
 
   test "resource/3 is zippable with inner enum" do
-    stream = Stream.resource(fn -> 1 end,
-                             fn 10 -> {:halt, 10}
-                                acc -> {acc..acc+2, acc + 1}
-                             end,
-                             fn _ -> Process.put(:stream_resource, true) end)
+    transform_fun = fn
+      10 -> {:halt, 10}
+      acc -> {acc..(acc + 2), acc + 1}
+    end
+
+    after_fun = fn _ -> Process.put(:stream_resource, true) end
+    stream = Stream.resource(fn -> 1 end, transform_fun, after_fun)
 
     list = Enum.to_list(stream)
     Process.put(:stream_resource, false)

  end

  test "zip/1 closes on outer error" do
    stream = Stream.zip([Stream.into([1, 2, 3], %Pdict{}), [:a, :b, :c]])
             |> Stream.map(fn _ -> throw(:error) end)

    Process.put(:stream_done, false)
    assert catch_throw(Enum.to_list(stream)) == :error

  end

  test "zip/1 does not leave streams suspended" do
    stream =
      Stream.resource(fn -> 1 end, fn acc -> {[acc], acc + 1} end, fn _ ->
        Process.put(:stream_zip, true)
      end)

    Process.put(:stream_zip, false)
    assert Stream.zip([[:a, :b, :c], stream]) |> Enum.to_list() == [a: 1, b: 2, c: 3]
    assert Process.get(:stream_zip)

    Process.put(:stream_zip, false)
    assert Stream.zip([stream, [:a, :b, :c]]) |> Enum.to_list() == [{1, :a}, {2, :b}, {3, :c}]
    assert Process.get(:stream_zip)
  end

  test "zip/1 does not leave streams suspended on halt" do
    stream =
      Stream.resource(fn -> 1 end, fn acc -> {[acc], acc + 1} end, fn _ ->
        Process.put(:stream_zip, :done)
      end)

    assert Stream.zip([[:a, :b, :c, :d, :e], stream]) |> Enum.take(3) == [a: 1, b: 2, c: 3]

    assert Process.get(:stream_zip) == :done
  end
