]>
Commit | Line | Data |
---|---|---|
6f161e0b JN |
1 | import |
2 | tables, | |
3 | unittest | |
d65a1dcf JN |
4 | |
5 | import lib | |
6f161e0b | 6 | import nimcoon |
d65a1dcf JN |
7 | |
8 | suite "Playing direct links": | |
9 | ||
10 | test "sanitize URL": | |
d65a1dcf JN |
11 | let expected = "https://www.youtube.com/watch?v=QOEMv0S8AcA" |
12 | check(sanitizeURL("https://youtu.be/QOEMv0S8AcA") == expected) | |
13 | check(sanitizeURL("https://www.youtube.com/watch\\?v\\=QOEMv0S8AcA") == expected) | |
6f161e0b JN |
14 | |
15 | test "validate options": | |
16 | let invalidOptions = to_table({"musicOnly": true, "feelingLucky": false, "fullScreen": true, "download": false}) | |
17 | check(not isValidOptions(invalidOptions)) | |
18 | let validOptions = to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": true}) | |
19 | check(isValidOptions(validOptions)) |