X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/blobdiff_plain/17955bba9f852c8264f1bfdf8259f19d4aeefd2a..6f161e0bd890c7289b54ad8ccfd5b73a416ea478:/tests/tests.nim diff --git a/tests/tests.nim b/tests/tests.nim index a218596..dad726c 100644 --- a/tests/tests.nim +++ b/tests/tests.nim @@ -1,6 +1,9 @@ -import unittest +import + tables, + unittest import lib +import nimcoon suite "Playing direct links": @@ -8,3 +11,9 @@ suite "Playing direct links": let expected = "https://www.youtube.com/watch?v=QOEMv0S8AcA" check(sanitizeURL("https://youtu.be/QOEMv0S8AcA") == expected) check(sanitizeURL("https://www.youtube.com/watch\\?v\\=QOEMv0S8AcA") == expected) + + test "validate options": + let invalidOptions = to_table({"musicOnly": true, "feelingLucky": false, "fullScreen": true, "download": false}) + check(not isValidOptions(invalidOptions)) + let validOptions = to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": true}) + check(isValidOptions(validOptions))