Last active
August 29, 2015 14:03
-
-
Save knewter/df4a651543c7587641f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
1) test sorts by the number of fields present in the doc (FindGoodSolrDocTest) | |
test/find_good_solr_doc_test.exs:24 | |
** (FunctionClauseError) no function clause matching in Enumerable.Function.reduce/3 | |
stacktrace: | |
(elixir) lib/enum.ex:2198: Enumerable.Function.reduce(#Function<0.18085451/1 in FindGoodSolrDocTest.test sorts by the number of fields present in the doc/1>, {:cont, []}, #Function<32.13715154/2 in Enum.reduce/3>) | |
(elixir) lib/enum.ex:1256: Enum.reduce/3 | |
(elixir) lib/enum.ex:1545: Enum.sort/2 | |
test/find_good_solr_doc_test.exs:27 |
This file contains hidden or 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
test "sorts by the number of fields present in the doc" do | |
output = @docs | |
|> Enum.map &({&1["id"], (Map.keys(&1) |> Enum.count)}) | |
|> Enum.sort(fn({_, a}, {_, b}) -> a > b end) | |
IO.inspect output | |
end |
This file contains hidden or 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
test "sorts by the number of fields present in the doc" do | |
list = @docs | |
|> Enum.map &({&1["id"], (Map.keys(&1) |> Enum.count)}) | |
output = Enum.sort(list, fn({_, a}, {_, b}) -> a > b end) | |
IO.inspect output | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment