summaryrefslogtreecommitdiff
path: root/test/src/editfns-tests.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-05-31 22:09:39 -0700
committerPhilipp Stephani <phst@google.com>2017-06-02 00:25:48 +0200
commit53247108411a1e9d1aa5352c231fa049f3f918aa (patch)
treebb550ccc67607f7f3cfc6a135b0838fff4b4c8c9 /test/src/editfns-tests.el
parent0dd1bbb0bb228acab21b8e16f2f2a0b5a17b19ab (diff)
downloademacs-53247108411a1e9d1aa5352c231fa049f3f918aa.tar.gz
emacs-53247108411a1e9d1aa5352c231fa049f3f918aa.tar.bz2
emacs-53247108411a1e9d1aa5352c231fa049f3f918aa.zip
Minor improvements to format field numbers
* src/editfns.c (styled_format): Allow field numbers in a %% spec. No need for a special diagnostic for field numbers greater than PTRDIFF_MAX. Reword diagnostic for field 0. * test/src/editfns-tests.el (format-with-field): Adjust to match.
Diffstat (limited to 'test/src/editfns-tests.el')
-rw-r--r--test/src/editfns-tests.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index f76c6c9fd36..c5923aaafb1 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -186,13 +186,9 @@
(should (equal (should-error (format "a %999999$s b" 11))
'(error "Not enough arguments for format string")))
(should (equal (should-error (format "a %$s b" 11))
- ;; FIXME: there shouldn't be two % in the error
- ;; string!
- '(error "Invalid format operation %%$")))
+ '(error "Invalid format operation %$")))
(should (equal (should-error (format "a %0$s b" 11))
- '(error "Invalid field number `0'")))
- (should (equal
- (should-error (format "a %1$% %s b" 11))
- '(error "Field number specified together with `%' conversion"))))
+ '(error "Invalid format field number 0")))
+ (should (equal (format "a %1$% %s b" 11) "a % 11 b")))
;;; editfns-tests.el ends here