2012-03-24 11:18:09 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
|
|
|
# T_355chapters
|
|
|
|
describe "mkvmerge / XML chapters"
|
|
|
|
|
2012-03-27 17:32:23 +00:00
|
|
|
source = "data/srt/ven.srt"
|
|
|
|
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
|
2012-03-26 07:48:11 +00:00
|
|
|
messages = merge "#{source} --chapters #{chapters}", :exit_code => 2
|
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
|