]> njoseph.me Git - nimcoon.git/blobdiff - tests.nim
Modularity and Tests
[nimcoon.git] / tests.nim
diff --git a/tests.nim b/tests.nim
new file mode 100644 (file)
index 0000000..f24eb18
--- /dev/null
+++ b/tests.nim
@@ -0,0 +1,11 @@
+import unittest
+
+import lib
+
+suite "Playing direct links":
+
+  test "sanitize URL":
+    # give up and stop if this fails
+    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)