aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-01 12:20:42 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-01 12:20:42 +0530
commitc8f520d56ded2e67a0c199d6b7e35f256bfae08e (patch)
tree9ca1ff4916a222499cc36c1d281e98067501821a
parentc8198418eecf50ed2deec4fbac55eaaf6cdd8a6a (diff)
tests: more error checking
-rwxr-xr-xtests.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests.lua b/tests.lua
index bc3ddf1..76417d3 100755
--- a/tests.lua
+++ b/tests.lua
@@ -6,18 +6,19 @@ local util = require 'lib/util'
local errs = 0
local test_subscene = function ()
- local out, ohash, name
+ local out, ohash, name, rc
out = os.tmpname()
- name = 'Fight Club (1999) (1080p BluRay x265 10bit Tigole) [QxR].mp4'
+ name = util.string_rm_vid_ext('Fight Club (1999) (1080p BluRay x265 10bit Tigole) [QxR].mp4')
ohash = 'ffec132e13e08f4c'
- if not subscene.search(name, out) then
+ rc = subscene.search(name, out)
+ if not rc then
util.error('subscene: fetch failed')
errs = errs + 1
end
- if ohash ~= util.opensubtitles_hash(out) then
+ if rc and ohash ~= util.opensubtitles_hash(out) then
util.error('subscene: hash mismatch')
errs = errs + 1
end