Created
May 26, 2017 14:54
-
-
Save mattludwigs/5bc8f1d26876b613b9ef22a524c6135a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MapComposeTest do | |
use ExUnit.Case | |
test "Enum.map function composition" do | |
not_inner_composed = | |
"hello world" | |
|> String.split(" ") | |
|> Enum.map(&String.reverse/1) | |
|> Enum.map(&String.upcase/1) | |
inner_composed = | |
"hello world" | |
|> String.split(" ") | |
|> Enum.map(& String.reverse(&1) |> String.upcase()) | |
assert not_inner_composed == inner_composed | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment