Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMush committed Sep 3, 2023
1 parent d8977ef commit 639bceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/parallel_progress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,10 @@ has_finished(p::ProgressThresh) = p.triggered
has_finished(p::ProgressUnknown) = p.done
has_finished(p::ParallelProgress) = isfakechannel(p.channel)
has_finished(p::MultipleProgress) = isfakechannel(p.channel)
has_finished(mc::MultipleChannel) = isfakechannel(mc)

Check warning on line 361 in src/parallel_progress.jl

View check run for this annotation

Codecov / codecov/patch

src/parallel_progress.jl#L361

Added line #L361 was not covered by tests

isfakechannel(_) = false
isfakechannel(::AbstractChannel) = false

Check warning on line 363 in src/parallel_progress.jl

View check run for this annotation

Codecov / codecov/patch

src/parallel_progress.jl#L363

Added line #L363 was not covered by tests
isfakechannel(::RemoteChannel) = false
isfakechannel(::FakeChannel) = true
isfakechannel(mc::MultipleChannel) = isfakechannel(mc.channel)

Expand Down
6 changes: 4 additions & 2 deletions test/test_multiple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ end
next!(p[1])
end
sleep(s)
@test !ProgressMeter.isfakechannel(p[1])
@test !ProgressMeter.isfakechannel(p.channel)
@test !ProgressMeter.isfakechannel(p[1].channel)
@test !has_finished(p)
next!(p[1])
sleep(s)
@test ProgressMeter.isfakechannel(p[1])
@test ProgressMeter.isfakechannel(p.channel)
@test ProgressMeter.isfakechannel(p[1].channel)
@test has_finished(p)

println("Testing MultipleProgress with custom titles and color")
Expand Down

0 comments on commit 639bceb

Please sign in to comment.