From 470acf6102ca7f5a5c938c9545d35e11924d42b2 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 7 Jul 2023 09:08:51 +0300 Subject: Add tests Simple tests, mainly to check if is-youtube and audio format are working properly to avoid previous issues. --- test/yeetube-tests.el | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/yeetube-tests.el (limited to 'test') 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 +;; 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 . + +;;; 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 -- cgit v1.2.3