2012-03-24 11:18:09 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
|
|
|
# T_355chapters
|
|
|
|
describe "mkvmerge / XML chapters"
|
|
|
|
|
2013-10-19 11:08:26 +00:00
|
|
|
source = "data/subtitles/srt/ven.srt"
|
2012-03-27 17:32:23 +00:00
|
|
|
invalid = Dir["data/text/chapters-invalid-*.xml"]
|
2012-03-24 11:18:09 +00:00
|
|
|
|
|
|
|
# Valid files:
|
2012-03-27 17:32:23 +00:00
|
|
|
(Dir["data/text/chapters-*.xml"] - invalid).sort.each do |chapters|
|
|
|
|
test_merge "#{source} --chapters #{chapters}"
|
2012-03-24 11:18:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Invalid files:
|
2012-03-27 17:32:23 +00:00
|
|
|
invalid.sort.each do |chapters|
|
2012-03-24 11:18:09 +00:00
|
|
|
test chapters do
|
2017-07-09 19:35:51 +00:00
|
|
|
messages, _ = merge("#{source} --chapters #{chapters}", :exit_code => :error)
|
2012-03-26 07:28:51 +00:00
|
|
|
messages.detect { |line| /The\s+XML\s+chapter\s+file.*contains\s+an\s+error/i.match line } ? :ok : :bad
|
2012-03-24 11:18:09 +00:00
|
|
|
end
|
|
|
|
end
|