Skip to content

Commit

Permalink
more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertDober committed Aug 12, 2022
1 parent 4845fbf commit 4628111
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions test/acceptance/earmark/pmap_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule Test.Acceptance.Earmark.PmapTest do
use ExUnit.Case

describe "pmap" do
test "it respects the order" do
result = ~W[AlPha BETA gamma] |> Earmark.pmap(&String.downcase/1)
assert result == ~W[alpha beta gamma]
end

test "with timeout" do
assert_raise Earmark.Error, fn ->
Earmark.pmap([1], fn _ -> Process.sleep(20) end, 10)
end
end
end

end
# SPDX-License-Identifier: Apache-2.0
3 changes: 2 additions & 1 deletion test/acceptance/earmark/postprocessor/change_mapper_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ defmodule Test.Acceptance.Earmark.Postprocessor.ChangeMapperTest do
html
end

defp main_mapper({_, _atts, _, _} = node) do
defp main_mapper(text) when is_binary(text), do: text
defp main_mapper(node) do
classes = Earmark.AstTools.find_att_in_node(node, "class") || ""

cond do
Expand Down

0 comments on commit 4628111

Please sign in to comment.