From c8f520d56ded2e67a0c199d6b7e35f256bfae08e Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 1 Oct 2023 12:20:42 +0530 Subject: tests: more error checking --- tests.lua | 9 +++++---- 1 file 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 -- cgit v1.2.3