aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/cl-seq-tests.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el b/test/lisp/emacs-lisp/cl-seq-tests.el
new file mode 100644
index 00000000000..d2eb412eee3
--- /dev/null
+++ b/test/lisp/emacs-lisp/cl-seq-tests.el
@@ -0,0 +1,42 @@
1;;; cl-seq-tests.el --- Tests for cl-seq.el functionality -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
4
5;; Author: Nicolas Richard <youngfrog@members.fsf.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;;; Code:
25
26(require 'ert)
27(require 'cl-seq)
28
29(ert-deftest cl-union-test-00 ()
30 (let ((str1 "foo")
31 (str2 (make-string 3 ?o)))
32 ;; Emacs may make two string literals eql when reading.
33 (aset str2 0 ?f)
34 (should (not (eql str1 str2)))
35 (should (equal str1 str2))
36 (should (equal (cl-union (list str1) (list str2))
37 (list str2)))
38 (should (equal (cl-union (list str1) (list str2) :test 'eql)
39 (list str1 str2)))))
40
41(provide 'cl-seq-tests)
42;;; cl-seq-tests.el ends here