Skip to content

Commit

Permalink
Fix deprecation errors and add tests (#141)
Browse files Browse the repository at this point in the history
* Fix deprecation error

* Add tests for deprecation

* Update Project.toml

* Add temporary Manifest.toml

* Remove temporary Manifest.toml
  • Loading branch information
VasanthManiVasi authored Apr 24, 2021
1 parent 2d61316 commit d580204
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MIDI"
uuid = "f57c4921-e30c-5f49-b073-3f2f2ada663e"
repo = "https://github.com/JuliaMusic/MIDI.jl.git"
version = "1.12.4"
version = "1.12.5"

[deps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand Down
6 changes: 3 additions & 3 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@deprecate writeMIDIFile(filename::AbstractString, data::MIDIFile) MIDI.save(filename, data)
@deprecate writeMIDIFile(filename::AbstractString, notes::Notes) MIDI.save(filename, notes)
@deprecate readMIDIFile(filename::AbstractString) MIDI.load(filename)
@deprecate writeMIDIFile(filename::AbstractString, data::MIDIFile) save(File{format"MIDI"}(filename), data)
@deprecate writeMIDIFile(filename::AbstractString, notes::Notes) save(File{format"MIDI"}(filename), notes)
@deprecate readMIDIFile(filename::AbstractString) load(File{format"MIDI"}(filename))
9 changes: 9 additions & 0 deletions test/midiio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ cd(@__DIR__)
@test notes[2].channel == 0

end

@testset "Deprecated MIDI IO" begin
midi = load("doxy.mid")
@test_deprecated readMIDIFile("doxy.mid")
@test_deprecated writeMIDIFile("test.mid", midi)
@test_deprecated writeMIDIFile("test.midi", getnotes(midi))
rm("test.mid")
rm("test.midi")
end

0 comments on commit d580204

Please sign in to comment.