mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 14:27:42 +00:00
c9eb86f88d
"playlist_file" must be an array of strings, not a single string. In verbose identification output mode this property has always been output multiple times. In JSON only one of those was actually output, the last one. Additionally the JSON schema didn't contain "playlist_file" at all.
46 lines
1.0 KiB
Ruby
Executable File
46 lines
1.0 KiB
Ruby
Executable File
#!/usr/bin/ruby -w
|
|
|
|
files = %w{
|
|
data/aac/v.aac
|
|
data/ac3/v.ac3
|
|
data/ssa-ass/fonts.ass
|
|
data/vobsub/ally1-short.idx
|
|
data/ts/timecode-overflow.m2ts
|
|
data/mp4/aac_encoder_delay_sample.m4a
|
|
data/mp4/o12-short.m4v
|
|
data/mkv/complex.mkv
|
|
data/pcm/big-endian.mka
|
|
data/ogg/video-1.1.ogv
|
|
data/vc1/MC.track_4113.vc1
|
|
data/vob/pcm-48kHz-2ch-16bit.vob
|
|
data/webm/yt3.webm
|
|
data/wp/with-correction.wv
|
|
data/wp/with-correction.wvc
|
|
}
|
|
|
|
describe "mkvmerge / JSON identification format"
|
|
|
|
test "identification and validation" do
|
|
hashes = []
|
|
|
|
files.each do |file|
|
|
output, _ = identify file, :format => :json
|
|
output = output.join ''
|
|
json = JSON.load(output)
|
|
|
|
valid, errors = json_schema_identification.validate(json)
|
|
|
|
if !valid
|
|
puts " JSON validation errors in #{file}:"
|
|
puts errors.join("\n")
|
|
end
|
|
|
|
json.delete("identification_format_version")
|
|
json_md5 = JSON.dump(json).md5
|
|
|
|
hashes << "#{json_md5}+#{valid ? "ok" : "invalid"}"
|
|
end
|
|
|
|
hashes.join '-'
|
|
end
|