aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-11 18:37:55 +0200
committerLars Ingebrigtsen2019-07-11 18:37:55 +0200
commitb41ddb7a8b11c8234e2f010d0db1b13e395468ae (patch)
treebc98fd7f90acdeec0e7c1691af9ec951ee26a330
parent50e7e8101ac6ebd536b6b63dbca99f901398c175 (diff)
downloademacs-b41ddb7a8b11c8234e2f010d0db1b13e395468ae.tar.gz
emacs-b41ddb7a8b11c8234e2f010d0db1b13e395468ae.zip
Add tests for format-spec
-rw-r--r--test/lisp/format-spec-tests.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/lisp/format-spec-tests.el b/test/lisp/format-spec-tests.el
new file mode 100644
index 00000000000..a5c62ac9ce3
--- /dev/null
+++ b/test/lisp/format-spec-tests.el
@@ -0,0 +1,33 @@
1;;; format-spec-tests.el --- tests for format-spec.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2019 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'ert)
23(require 'format-spec)
24
25(ert-deftest test-format-spec ()
26 (should (equal (format-spec "foo %b zot" '((?b . "bar")))
27 "foo bar zot"))
28 (should (equal (format-spec "foo %-10b zot" '((?b . "bar")))
29 "foo bar zot"))
30 (should (equal (format-spec "foo %10b zot" '((?b . "bar")))
31 "foo bar zot")))
32
33;;; format-spec-tests.el ends here