mirror of
https://github.com/ksyasuda/mpv-youtube-queue.git
synced 2026-03-22 18:11:27 -07:00
refactor: split script into modules and drop queue save/load
All checks were successful
Luacheck / luacheck (push) Successful in 58s
All checks were successful
Luacheck / luacheck (push) Successful in 58s
This commit is contained in:
17
tests/input_spec.lua
Normal file
17
tests/input_spec.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local input = require("input")
|
||||
|
||||
local function eq(actual, expected, message)
|
||||
assert(actual == expected, string.format("%s: expected %s, got %s", message, tostring(expected), tostring(actual)))
|
||||
end
|
||||
|
||||
do
|
||||
local sanitized = input.sanitize_source([[ "Mary's Video.mp4"
|
||||
]])
|
||||
eq(sanitized, "Mary's Video.mp4", "sanitize should trim wrapper quotes and whitespace without dropping apostrophes")
|
||||
end
|
||||
|
||||
do
|
||||
eq(input.is_file_info({ is_file = true }), true, "file info should accept files")
|
||||
eq(input.is_file_info({ is_file = false }), false, "file info should reject directories")
|
||||
eq(input.is_file_info(nil), false, "file info should reject missing paths")
|
||||
end
|
||||
Reference in New Issue
Block a user