summaryrefslogtreecommitdiff
path: root/test/lisp/format-spec-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/format-spec-tests.el')
-rw-r--r--test/lisp/format-spec-tests.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lisp/format-spec-tests.el b/test/lisp/format-spec-tests.el
index 11882217afb..ff2abdeaad5 100644
--- a/test/lisp/format-spec-tests.el
+++ b/test/lisp/format-spec-tests.el
@@ -1,6 +1,6 @@
;;; format-spec-tests.el --- tests for format-spec.el -*- lexical-binding: t -*-
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
@@ -178,4 +178,14 @@
(should (equal (format-spec "foo %>4b zot" '((?b . "longbar")))
"foo long zot")))
+(ert-deftest format-spec-split ()
+ (should (equal (format-spec "foo %b bar" '((?b . "zot")) nil t)
+ '("foo " "zot" " bar")))
+ (should (equal (format-spec "%b bar" '((?b . "zot")) nil t)
+ '("zot" " bar")))
+ (should (equal (format-spec "%b" '((?b . "zot")) nil t)
+ '("zot")))
+ (should (equal (format-spec "foo %b" '((?b . "zot")) nil t)
+ '("foo " "zot"))))
+
;;; format-spec-tests.el ends here