aboutsummaryrefslogtreecommitdiff
path: root/tests.lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-03 09:17:48 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-03 19:00:49 +0530
commit71f7b25ab3c8302972998714e98a5126cf1259e5 (patch)
tree62e6d1fb4beb45dc205d90780e0e03977694f6a9 /tests.lua
parent4173db8196a492e76f28d09946acee0e198ef3ad (diff)
tests: fix, avoid matching on nil
Diffstat (limited to 'tests.lua')
-rwxr-xr-xtests.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests.lua b/tests.lua
index 4421b57..f519964 100755
--- a/tests.lua
+++ b/tests.lua
@@ -32,7 +32,11 @@ local test_opensubtitles = function ()
ohash = '395787dbe5b42001'
id = '5449593'
- new_id = opensubtitles.search_ohash(ohash):match('%d*$')
+ new_id = opensubtitles.search_ohash(ohash)
+ if new_id then
+ new_id = new_id:match('%d*$')
+ end
+
if id ~= new_id then
util.error('opensubtitles: id mismatch')
errs = errs + 1