]> njoseph.me Git - nimcoon.git/blobdiff - tests/tests.nim
Be a nimble package
[nimcoon.git] / tests / tests.nim
diff --git a/tests/tests.nim b/tests/tests.nim
new file mode 100644 (file)
index 0000000..a218596
--- /dev/null
@@ -0,0 +1,10 @@
+import unittest
+
+import lib
+
+suite "Playing direct links":
+
+  test "sanitize URL":
+    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)