mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 14:27:42 +00:00
d433bcb30f
Implements #504, #814.
34 lines
1020 B
Ruby
34 lines
1020 B
Ruby
#!/usr/bin/ruby -w
|
|
|
|
# T_382split_chapters
|
|
describe "mkvmerge / splitting by chapters"
|
|
|
|
avi = "data/avi/v-h264-aac.avi"
|
|
chapters = "data/text/chapters-v-h264-aac.txt"
|
|
|
|
def hash_results max
|
|
( (1..max).collect { |i| hash_file(sprintf("%s-%02d", tmp, i)) } + [ File.exists?(sprintf("%s-%02d", tmp, max + 1)) ? 'bad' : 'ok' ]).join '+'
|
|
end
|
|
|
|
test "chapters-in-mkv: numbers 1 & 7" do
|
|
merge "#{avi} --chapters #{chapters}", :output => "#{tmp}-src"
|
|
merge "#{tmp}-src --split chapters:1,7", :output => "#{tmp}-%02d"
|
|
hash_results 2
|
|
end
|
|
|
|
test "chapters-external: numbers 1 & 7" do
|
|
merge "#{avi} --chapters #{chapters} --split chapters:1,7", :output => "#{tmp}-%02d"
|
|
hash_results 2
|
|
end
|
|
|
|
test "chapters-in-mkv: all" do
|
|
merge "#{avi} --chapters #{chapters}", :output => "#{tmp}-src"
|
|
merge "#{tmp}-src --split chapters:all", :output => "#{tmp}-%02d"
|
|
hash_results 17
|
|
end
|
|
|
|
test "chapters-external: all" do
|
|
merge "#{avi} --chapters #{chapters} --split chapters:all", :output => "#{tmp}-%02d"
|
|
hash_results 17
|
|
end
|