Skip to content

Commit

Permalink
test running without any jobs does not blow up
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Mar 16, 2019
1 parent 9ed2856 commit 33a83c1
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions test/benchee_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -592,20 +592,34 @@ defmodule BencheeTest do
end)
end

test "does not blow up setting all times to 0 and never executes a function" do
output =
capture_io(fn ->
Benchee.run(
%{
"never execute me" => fn -> raise "BOOOOM" end
},
time: 0,
warmup: 0,
memory_time: 0
)
end)
describe "edge cases" do
test "does not blow up setting all times to 0 and never executes a function" do
output =
capture_io(fn ->
Benchee.run(
%{
"never execute me" => fn -> raise "BOOOOM" end
},
time: 0,
warmup: 0,
memory_time: 0
)
end)

refute output =~ "never execute me"
end

test "does not blow up if nothing is specified" do
output =
capture_io(fn ->
Benchee.run(
%{},
@test_configuration
)
end)

refute output =~ "never execute me"
refute output =~ "Benchmarking"
end
end

describe "save & load" do
Expand Down

0 comments on commit 33a83c1

Please sign in to comment.