diff options
| author | Dmitry Antipov | 2014-05-15 14:06:45 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-05-15 14:06:45 +0400 |
| commit | 92491099f710794ee2be60721fae50d68c5ca162 (patch) | |
| tree | 42a7b0cc49fd238db2c1bf645374dbfaa5364f1b | |
| parent | 27f13b21fd11706158da57e0daab4fc5651cd47f (diff) | |
| download | emacs-92491099f710794ee2be60721fae50d68c5ca162.tar.gz emacs-92491099f710794ee2be60721fae50d68c5ca162.zip | |
* tests/automated/fns-tests.el: New file.
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/fns-tests.el | 39 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index d033548215b..cd5398e9b99 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-05-15 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/fns-tests.el: New file. | ||
| 4 | |||
| 1 | 2014-05-08 Glenn Morris <rgm@gnu.org> | 5 | 2014-05-08 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781) | 7 | * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781) |
diff --git a/test/automated/fns-tests.el b/test/automated/fns-tests.el new file mode 100644 index 00000000000..2e71854261e --- /dev/null +++ b/test/automated/fns-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; fns-tests.el --- tests for src/fns.c | ||
| 2 | |||
| 3 | ;; Copyright (C) 2014 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 | (require 'cl-lib) | ||
| 25 | (eval-when-compile (require 'cl)) | ||
| 26 | |||
| 27 | (ert-deftest fns-tests-reverse () | ||
| 28 | (should-error (reverse)) | ||
| 29 | (should-error (reverse 1)) | ||
| 30 | (should-error (reverse (make-char-table 'foo))) | ||
| 31 | (should (equal [1 2 3 4] (reverse (reverse [1 2 3 4])))) | ||
| 32 | (should (equal "xyzzy" (reverse (reverse "xyzzy")))) | ||
| 33 | (should (equal "こんにちは / コンニチハ" (reverse (reverse "こんにちは / コンニチハ"))))) | ||
| 34 | |||
| 35 | (ert-deftest fns-tests-reverse-bool-vector () | ||
| 36 | (let ((A (make-bool-vector 10 nil))) | ||
| 37 | (dotimes (i 5) (aset A i t)) | ||
| 38 | (should (equal [nil nil nil nil nil t t t t t] (vconcat (reverse A)))) | ||
| 39 | (should (equal A (reverse (reverse A)))))) | ||