Skip to content

Commit

Permalink
Test to ascertain that we don't crash if nothing is collected (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Feb 10, 2019
1 parent b742684 commit b224692
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/benchee/formatters/csv_integration_test.exs
Expand Up @@ -22,6 +22,25 @@ defmodule Benchee.Formatters.CSVIntegrationTest do
)
end

test "doesn't blow up if we gather no data" do
capture_io(fn ->
assert %Benchee.Suite{} =
Benchee.run(
%{
"Sleep" => fn -> :timer.sleep(10) end,
"List" => fn -> [:rand.uniform()] end
},
time: 0,
warmup: 0,
memory_time: 0,
formatters: [Benchee.Formatters.CSV]
)
end)
after
if File.exists?(@filename), do: File.rm!(@filename)
if File.exists?(@raw_filename), do: File.rm!(@raw_filename)
end

defp basic_test(configuration) do
capture_io(fn ->
Benchee.run(
Expand Down

0 comments on commit b224692

Please sign in to comment.