aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-07 09:08:51 +0300
committerThanos Apollo <[email protected]>2023-07-07 09:08:51 +0300
commit470acf6102ca7f5a5c938c9545d35e11924d42b2 (patch)
tree1383e38a433a5fa95df88faf22331e3b3cf8769c /test
parent14c593711d66fba6810eea775f4e2360d900d822 (diff)
Add tests
Simple tests, mainly to check if is-youtube and audio format are working properly to avoid previous issues.
Diffstat (limited to 'test')
-rw-r--r--test/yeetube-tests.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/yeetube-tests.el b/test/yeetube-tests.el
new file mode 100644
index 0000000..4c95516
--- /dev/null
+++ b/test/yeetube-tests.el
@@ -0,0 +1,44 @@
+;;; yeetube-tests.el --- tests for yeetube.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2023 Thanos Apollo
+
+;; Author: Thanos Apollo <[email protected]>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+(require 'ert)
+(load-file "../yeetube.el")
+(require 'yeetube)
+
+(ert-deftest test-is-youtube? ()
+ (should (equal (yeetube-check-if-youtube "youtube.com") t))
+ (should (equal (yeetube-check-if-youtube "localhost") nil))
+ (should (equal (yeetube-check-if-youtube "yewtu.be") nil)))
+
+(ert-deftest test-download-audio-format ()
+ (should (equal yeetube-download-audio-format nil))
+ (yeetube-change-download-audio-format "m4a")
+ (should (equal yeetube-download-audio-format "m4a")))
+
+
+(ert-run-tests-batch-and-exit)
+
+(provide 'yeetube-tests)
+;;; yeetube-tests.el ends here