diff options
| author | Paul Eggert | 2017-05-31 22:09:39 -0700 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-02 00:25:48 +0200 |
| commit | 53247108411a1e9d1aa5352c231fa049f3f918aa (patch) | |
| tree | bb550ccc67607f7f3cfc6a135b0838fff4b4c8c9 /test | |
| parent | 0dd1bbb0bb228acab21b8e16f2f2a0b5a17b19ab (diff) | |
| download | emacs-53247108411a1e9d1aa5352c231fa049f3f918aa.tar.gz 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')
| -rw-r--r-- | test/src/editfns-tests.el | 10 |
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 @@ | |||
| 186 | (should (equal (should-error (format "a %999999$s b" 11)) | 186 | (should (equal (should-error (format "a %999999$s b" 11)) |
| 187 | '(error "Not enough arguments for format string"))) | 187 | '(error "Not enough arguments for format string"))) |
| 188 | (should (equal (should-error (format "a %$s b" 11)) | 188 | (should (equal (should-error (format "a %$s b" 11)) |
| 189 | ;; FIXME: there shouldn't be two % in the error | 189 | '(error "Invalid format operation %$"))) |
| 190 | ;; string! | ||
| 191 | '(error "Invalid format operation %%$"))) | ||
| 192 | (should (equal (should-error (format "a %0$s b" 11)) | 190 | (should (equal (should-error (format "a %0$s b" 11)) |
| 193 | '(error "Invalid field number `0'"))) | 191 | '(error "Invalid format field number 0"))) |
| 194 | (should (equal | 192 | (should (equal (format "a %1$% %s b" 11) "a % 11 b"))) |
| 195 | (should-error (format "a %1$% %s b" 11)) | ||
| 196 | '(error "Field number specified together with `%' conversion")))) | ||
| 197 | 193 | ||
| 198 | ;;; editfns-tests.el ends here | 194 | ;;; editfns-tests.el ends here |