Skip to content

Commit

Permalink
Merge pull request #4830 from agdestein/fix-animation-constructor
Browse files Browse the repository at this point in the history
Add missing Animation constructor
  • Loading branch information
BeastyBlacksmith authored Oct 19, 2023
2 parents 5ec0b87 + 3ab6b33 commit 0dbcd90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,11 @@
"name": "Alexander Von Moll",
"orcid": "0000-0002-7661-5752",
"type": "Other"
},
{
"name": "Syver Døving Agdestein",
"orcid": "0000-0002-1589-2916",
"type": "Other"
}
],
"upload_type": "software"
Expand Down
2 changes: 1 addition & 1 deletion src/animation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Animation
frames::Vector{String}
end

Animation() = Animation(convert(String, mktempdir()), String[])
Animation(dir = convert(String, mktempdir())) = Animation(dir, String[])

"""
frame(animation[, plot])
Expand Down
11 changes: 11 additions & 0 deletions test/test_animations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
@testset "Animation constructors" begin
@test Animation() isa Animation
@test Animation("dir") isa Animation
@test Animation("dir", String[]) isa Animation
end

@testset "Missing animation directory" begin
anim = Animation("nonexisting_dir")
@test_throws SystemError frame(anim, plot([1, 2, 3]))
end

@testset "Empty anim" begin
anim = @animate for i in []
end
Expand Down

0 comments on commit 0dbcd90

Please sign in to comment.