]> code.delx.au - gnu-emacs/blob - test/automated/data-tests.el
merge trunk
[gnu-emacs] / test / automated / data-tests.el
1 ;;; data-tests.el --- tests for src/data.c
2
3 ;; Copyright (C) 2013 Free Software Foundation, Inc.
4
5 ;; This file is part of GNU Emacs.
6
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.
11 ;;
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.
16 ;;
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/'.
19
20 ;;; Commentary:
21
22 ;;; Code:
23
24 (ert-deftest data-tests-= ()
25 (should-error (=))
26 (should (= 1))
27 (should (= 2 2))
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)))
33
34 (ert-deftest data-tests-< ()
35 (should-error (<))
36 (should (< 1))
37 (should (< 2 3))
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)))
43
44 (ert-deftest data-tests-> ()
45 (should-error (>))
46 (should (> 1))
47 (should (> 3 2))
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)))
53
54 (ert-deftest data-tests-<= ()
55 (should-error (<=))
56 (should (<= 1))
57 (should (<= 2 3))
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)))
63
64 (ert-deftest data-tests->= ()
65 (should-error (>=))
66 (should (>= 1))
67 (should (>= 3 2))
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)))
73
74 ;;; data-tests.el ends here
75