mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-23 19:31:44 +00:00
tests: switch to mkvextract's new syntax
This commit is contained in:
parent
88ef93984f
commit
d672c35354
2
tests/test-360X_chapters_hex_format.rb
Normal file → Executable file
2
tests/test-360X_chapters_hex_format.rb
Normal file → Executable file
@ -5,6 +5,6 @@ describe "mkvextract / extract XML chapters with binary elements (hex format)"
|
||||
|
||||
test_merge "data/subtitles/srt/ven.srt --chapters data/text/chapters-hex-format.xml", :keep_tmp => true
|
||||
test "extraction" do
|
||||
extract "#{tmp} > #{tmp}-chapters", :mode => :chapters
|
||||
extract tmp, :mode => :chapters, :args => "#{tmp}-chapters"
|
||||
hash_file "#{tmp}-chapters"
|
||||
end
|
||||
|
2
tests/test-374extract_chapters_with_ebml_void.rb
Normal file → Executable file
2
tests/test-374extract_chapters_with_ebml_void.rb
Normal file → Executable file
@ -4,6 +4,6 @@
|
||||
describe "mkvextract / extract chapters with EbmlVoid elements"
|
||||
|
||||
test 'extraction' do
|
||||
output = extract("data/mkv/chapters-with-ebmlvoid.mkv", :mode => :chapters).join('')
|
||||
output = extract("data/mkv/chapters-with-ebmlvoid.mkv", :mode => :chapters, :args => "-").join('')
|
||||
/ebml.?void/i.match(output) ? 'BAD' : 'ok'
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ file = "data/mkv/complex.mkv"
|
||||
|
||||
describe "mkvextract / write BOMs only once with --redirect-output"
|
||||
test "extraction via shell redirection" do
|
||||
extract(file, :mode => :chapters).
|
||||
extract(file, :mode => :chapters, :args => "-").
|
||||
slice(0..-2).
|
||||
join('').
|
||||
md5
|
||||
|
@ -6,7 +6,7 @@ describe "mkvextract / chapters in simple format including language selection"
|
||||
%w{love phantom}.each do |file|
|
||||
[ "", "--simple-language eng", "--simple-language spa" ].each do |language|
|
||||
test "extract from #{file} #{language}" do
|
||||
extract "data/chapters/#{file}.mkv --simple #{language} > #{tmp}", :mode => :chapters
|
||||
extract "data/chapters/#{file}.mkv", :args => "--simple #{language} #{tmp}", :mode => :chapters
|
||||
hash_tmp
|
||||
end
|
||||
end
|
||||
|
@ -7,6 +7,6 @@ test_merge "data/subtitles/srt/ven.srt", :args => "--chapters data/chapters/uk-a
|
||||
test_merge "data/mkv/chapters-uk-and-gb.mks"
|
||||
|
||||
test "fix during extraction" do
|
||||
extract "data/mkv/chapters-uk-and-gb.mks > #{tmp}", :mode => :chapters
|
||||
extract "data/mkv/chapters-uk-and-gb.mks", :args => tmp, :mode => :chapters
|
||||
hash_tmp
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ describe "mkvmerge / generate chapters without names"
|
||||
|
||||
test_merge "data/simple/v.mp3", args: "--generate-chapters interval:10s --generate-chapters-name-template ''", :keep_tmp => true
|
||||
test :chapter_names do
|
||||
extract "#{tmp} > #{tmp}-2", :mode => :chapters
|
||||
extract tmp, :args => "#{tmp}-2", :mode => :chapters
|
||||
content = IO.readlines("#{tmp}-2").join("")
|
||||
ok = %r{ChapterAtom}.match(content) && !%r{Chapter(Display|String|Language)}.match(content)
|
||||
fail "chapter content is bad" if !ok
|
||||
|
@ -276,7 +276,8 @@ class SimpleTest
|
||||
fail ArgumentError if args.empty?
|
||||
|
||||
mode = options[:mode] || :tracks
|
||||
command = "../src/mkvextract --engage no_variable_data #{mode} #{args.first} " + options.keys.select { |key| key.is_a?(Numeric) }.sort.collect { |key| "#{key}:#{options[key]}" }.join(' ')
|
||||
command = "../src/mkvextract --engage no_variable_data #{args.first} #{mode} " + options.keys.select { |key| key.is_a?(Numeric) }.sort.collect { |key| "#{key}:#{options[key]}" }.join(' ')
|
||||
command += options[:args] if options.key?(:args)
|
||||
|
||||
self.sys command, :exit_code => options[:exit_code], :no_result => options[:no_result]
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user