aboutsummaryrefslogtreecommitdiff
path: root/tests.lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-03-05 07:47:32 +0530
committersinanmohd <sinan@sinanmohd.com>2024-03-05 07:47:32 +0530
commitdd40ef157b64aa6d2b3032f2d97468aae31747ed (patch)
treefc56d9a90481710728acba9cdc59c9dd7f5b7fdf /tests.lua
parentf43cd4c508e5f90a35cace9ef3c97586ba7c1967 (diff)
fmt: init stylua
Diffstat (limited to 'tests.lua')
-rwxr-xr-xtests.lua43
1 files changed, 21 insertions, 22 deletions
diff --git a/tests.lua b/tests.lua
index 5520bcb..737f4e4 100755
--- a/tests.lua
+++ b/tests.lua
@@ -1,35 +1,34 @@
#!/usr/bin/env lua
-local opensubtitles = require 'server.opensubtitles'
+local opensubtitles = require("server.opensubtitles")
-local note = function (success, name)
- local sign
+local note = function(success, name)
+ local sign
- if success then
- sign = '✅'
- else
- sign = '❌'
- end
+ if success then
+ sign = "✅"
+ else
+ sign = "❌"
+ end
- print(sign .. ' : ' .. name)
+ print(sign .. " : " .. name)
end
+local test_opensubtitles = function()
+ local ohash, name, id
-local test_opensubtitles = function ()
- local ohash, name, id
+ ohash = "395787dbe5b42001"
+ name = "Fight.Club.1999.REMASTERED.720p.BRRip.XviD.AC3-RARBG"
+ id = opensubtitles.search_ohash(ohash, name, "eng")
+ note(id and id:match("%d+$") == "5449593", "search_ohash")
- ohash = '395787dbe5b42001'
- name = 'Fight.Club.1999.REMASTERED.720p.BRRip.XviD.AC3-RARBG'
- id = opensubtitles.search_ohash(ohash, name, 'eng')
- note(id and id:match('%d+$') == '5449593', 'search_ohash')
+ name = "Fight.Club.10th.Anniversary.Edition.1999.720p.BrRip.x264.YIFY"
+ id = opensubtitles.search_filesize(1074575924, name, "eng")
+ note(id and id:match("%d+$") == "4987774", "search_filesize")
- name = 'Fight.Club.10th.Anniversary.Edition.1999.720p.BrRip.x264.YIFY'
- id = opensubtitles.search_filesize(1074575924, name, 'eng')
- note(id and id:match('%d+$') == '4987774', 'search_filesize')
-
- name = 'Fight.Club.1999.REMASTERED.720p.BRRip.XviD.AC3-RARBG'
- id = opensubtitles.search_name(name, 'eng')
- note(id and id:match('%d+$') == '5449593', 'search_name')
+ name = "Fight.Club.1999.REMASTERED.720p.BRRip.XviD.AC3-RARBG"
+ id = opensubtitles.search_name(name, "eng")
+ note(id and id:match("%d+$") == "5449593", "search_name")
end
test_opensubtitles()