X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ab422c4d6899b1442cb6954c1829c1fb656b006c..7e09ef09a479731d01b1ca46e94ddadd73ac98e3:/test/automated/newsticker-tests.el diff --git a/test/automated/newsticker-tests.el b/test/automated/newsticker-tests.el index 4fe656e692..1e51b9eb69 100644 --- a/test/automated/newsticker-tests.el +++ b/test/automated/newsticker-tests.el @@ -1,6 +1,6 @@ ;;; newsticker-testsuite.el --- Test suite for newsticker. -;; Copyright (C) 2003-2013 Free Software Foundation, Inc. +;; Copyright (C) 2003-2015 Free Software Foundation, Inc. ;; Author: Ulf Jasper ;; Keywords: News, RSS, Atom @@ -143,6 +143,26 @@ Signals an error if something goes wrong." (should (equal '("Feeds" "feed3" "feed2" "feed1") newsticker-groups)))) +(ert-deftest newsticker--group-find-parent-group () + "Test `newsticker--group-find-parent-group'." + (let ((newsticker-groups '("g1" "f1a" ("g2" "f2" ("g3" "f3a" "f3b")) "f1b"))) + ;; feeds + (should (equal "g1" (car (newsticker--group-find-parent-group "f1a")))) + (should (equal "g1" (car (newsticker--group-find-parent-group "f1b")))) + (should (equal "g2" (car (newsticker--group-find-parent-group "f2")))) + (should (equal "g3" (car (newsticker--group-find-parent-group "f3b")))) + ;; groups + (should (equal "g1" (car (newsticker--group-find-parent-group "g2")))) + (should (equal "g2" (car (newsticker--group-find-parent-group "g3")))))) + +(ert-deftest newsticker--group-do-rename-group () + "Test `newsticker--group-do-rename-group'." + (let ((newsticker-groups '("g1" "f1a" ("g2" "f2" ("g3" "f3a" "f3b")) "f1b"))) + (should (equal '("g1" "f1a" ("h2" "f2" ("g3" "f3a" "f3b")) "f1b") + (newsticker--group-do-rename-group "g2" "h2"))) + )) + + (provide 'newsticker-tests) ;;; newsticker-tests.el ends here