1 ;;; data-tests.el --- tests for src/data.c
3 ;; Copyright (C) 2013 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; This program is free software: you can redistribute it and/or
8 ;; modify it under the terms of the GNU General Public License as
9 ;; published by the Free Software Foundation, either version 3 of the
10 ;; License, or (at your option) any later version.
12 ;; This program is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program. If not, see `http://www.gnu.org/licenses/'.
24 (ert-deftest data-tests-= ()
28 (should (= 9 9 9 9 9 9 9 9 9))
29 (should-not (apply #'= '(3 8 3)))
30 (should-error (= 9 9 'foo))
31 ;; Short circuits before getting to bad arg
32 (should-not (= 9 8 'foo)))
34 (ert-deftest data-tests-< ()
38 (should (< -6 -1 0 2 3 4 8 9 999))
39 (should-not (apply #'< '(3 8 3)))
40 (should-error (< 9 10 'foo))
41 ;; Short circuits before getting to bad arg
42 (should-not (< 9 8 'foo)))
44 (ert-deftest data-tests-> ()
48 (should (> 6 1 0 -2 -3 -4 -8 -9 -999))
49 (should-not (apply #'> '(3 8 3)))
50 (should-error (> 9 8 'foo))
51 ;; Short circuits before getting to bad arg
52 (should-not (> 8 9 'foo)))
54 (ert-deftest data-tests-<= ()
58 (should (<= -6 -1 -1 0 0 0 2 3 4 8 999))
59 (should-not (apply #'<= '(3 8 3 3)))
60 (should-error (<= 9 10 'foo))
61 ;; Short circuits before getting to bad arg
62 (should-not (<= 9 8 'foo)))
64 (ert-deftest data-tests->= ()
68 (should (>= 666 1 0 0 -2 -3 -3 -3 -4 -8 -8 -9 -999))
69 (should-not (apply #'>= '(3 8 3)))
70 (should-error (>= 9 8 'foo))
71 ;; Short circuits before getting to bad arg
72 (should-not (>= 8 9 'foo)))
74 ;;; data-tests.el ends here