;;; test-org-plot.el --- Tests for Org Plot library -*- lexical-binding: t; -*- ;; Copyright (C) 2020 Mario Frasca ;; Author: Mario Frasca ;; This file is not part of GNU Emacs. ;; 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 . ;;; Code: (require 'org-test) (require 'org-plot) ;; General auxiliaries (ert-deftest test-org-plot/zip-deps-with () "Test `org-plot/zip-deps-with' specifications." ;; no deps, no with. defaults to all except ind, and "lines" (should (equal (org-plot/zip-deps-with 3 1 nil nil) '((2 . "lines") (3 . "lines")))) ;; no deps, single with. defaults to all except ind, and repeated with (should (equal (org-plot/zip-deps-with 3 1 nil "hist") '((2 . "hist") (3 . "hist")))) ;; no deps, explicit with (should (equal (org-plot/zip-deps-with 3 1 nil '("points" "hist")) '((2 . "points") (3 . "hist")))) ;; explicit with, same length as deps (should (equal (org-plot/zip-deps-with 5 1 '(2 4) '("points" "hist")) '((2 . "points") (4 . "hist")))) ;; same as above, but different order (should (equal (org-plot/zip-deps-with 5 1 '(4 2) '("points" "hist")) '((4 . "points") (2 . "hist")))) ;; if with exceeds deps, trailing elements are discarded (should (equal (org-plot/zip-deps-with 5 1 '(4 2) '("points" "hist" "lines")) '((4 . "points") (2 . "hist")))) ;; fills in with "lines" (should (equal (org-plot/zip-deps-with 5 1 '(4 2 3) '("points")) '((4 . "points") (2 . "lines") (3 . "lines"))))) (provide 'test-org-plot) ;;; test-org-plot.el end here