mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
tests: utility function for reading doc type (read) version elements
This commit is contained in:
parent
83a933ac23
commit
df79a16c64
@ -18,10 +18,8 @@ test "all versions" do
|
||||
command = command.join ' '
|
||||
|
||||
merge command
|
||||
output = info(tmp, :output => :return).join('')
|
||||
|
||||
type_version = /Document type version:\s+(\d+)/.match(output) ? $1 : '<undef>'
|
||||
type_read_version = /Document type read version:\s+(\d+)/.match(output) ? $1 : '<undef>'
|
||||
type_version, type_read_version = get_doc_type_versions(tmp)
|
||||
|
||||
hashes << "#{type_version}+#{type_read_version}"
|
||||
end
|
||||
|
@ -19,10 +19,8 @@ test "all versions" do
|
||||
command = command.join ' '
|
||||
|
||||
merge command
|
||||
output = info(tmp, :output => :return).join('')
|
||||
|
||||
type_version = /Document type version:\s+(\d+)/.match(output) ? $1 : '<undef>'
|
||||
type_read_version = /Document type read version:\s+(\d+)/.match(output) ? $1 : '<undef>'
|
||||
type_version, type_read_version = get_doc_type_versions(tmp)
|
||||
|
||||
hashes << "#{type_version}+#{type_read_version}"
|
||||
end
|
||||
|
@ -268,7 +268,7 @@ class SimpleTest
|
||||
output = "> #{output}" unless %r{^[>\|]}.match(output)
|
||||
output = '' if options[:output] == :return
|
||||
command = "../src/mkvinfo --engage no_variable_data --ui-language en_US #{args.first} #{output}"
|
||||
self.sys command, :exit_code => options[:exit_code], :no_result => options[:no_result]
|
||||
self.sys command, :exit_code => options[:exit_code], :no_result => options[:no_result], :dont_record_command => options[:dont_record_command]
|
||||
end
|
||||
|
||||
def extract *args
|
||||
@ -360,4 +360,12 @@ class SimpleTest
|
||||
end.
|
||||
join("/")
|
||||
end
|
||||
|
||||
def get_doc_type_versions file_name
|
||||
output = info(file_name, :output => :return, :dont_record_command => true).join('')
|
||||
type_version = /Document type version:\s+(\d+)/.match(output) ? $1 : nil
|
||||
type_read_version = /Document type read version:\s+(\d+)/.match(output) ? $1 : nil
|
||||
|
||||
return type_version, type_read_version
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user