mkvtoolnix/tests/test-0533chapter_generation_interval.rb
Moritz Bunkus ab6455f68c
build system: fix compatibility with Ruby 3.2.0
Several deprecated functions were removed: `Dir.exists?`,
`File.exists?` & `FileTest.exists?`.  Instead of those
`FileTest.exist?` must be used (without the `s`). See the release
notes for Ruby 3.2.0 as well as the issue for removing the functions:

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
https://bugs.ruby-lang.org/issues/17391
2023-01-02 22:57:21 +01:00

18 lines
762 B
Ruby
Executable File

#!/usr/bin/ruby -w
file = "data/avi/v-h264-aac.avi"
# T_533chapter_generation_interval
describe "mkvmerge / generate chapter »interval«"
def hash_results max
( (1..max).collect { |i| hash_file(sprintf("%s-%02d", tmp, i)) } + [ FileTest.exist?(sprintf("%s-%02d", tmp, max + 1)) ? 'bad' : 'ok' ]).join '+'
end
test_merge "#{file} + #{file} + #{file}", :args => "--generate-chapters interval:30s"
test_merge "#{file} + #{file} + #{file}", :args => "--chapter-language ger --generate-chapters interval:30s"
test "creation and splitting" do
merge "--chapter-language ger --generate-chapters interval:30s --split 30s #{file} + #{file} + #{file}", :output => "#{tmp}-%02d"
hash_results 7
end
test_merge "#{file}", :args => "--generate-chapters interval:30s"