aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-06-03 11:16:21 +0200
committerPhilipp Stephani2017-06-03 11:19:02 +0200
commit7d413cb4da89e0bdd70068e6a5e1dbc57190ed10 (patch)
tree6ca93c8b51c29a3189d00abdc5d1f419981b8b81 /test/src
parent0147cdd4d96f1eaeef720ee0b89bddd27eaf4233 (diff)
downloademacs-7d413cb4da89e0bdd70068e6a5e1dbc57190ed10.tar.gz
emacs-7d413cb4da89e0bdd70068e6a5e1dbc57190ed10.zip
Fix a bug when using format field numbers
Previously styled_format overwrite the argument vector. This is no longer possible because there might be more than one specification per argument. Use the existing auxiliary info array instead. * src/editfns.c (styled_format): Record arguments in the info structure instead of overwriting them. * test/src/editfns-tests.el (format-with-field): Add unit test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/editfns-tests.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index 54fb743e192..3073e371933 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -205,6 +205,7 @@
205 (should (equal (should-error (format "a %$s b" 11)) 205 (should (equal (should-error (format "a %$s b" 11))
206 '(error "Invalid format operation %$"))) 206 '(error "Invalid format operation %$")))
207 (should (equal (should-error (format "a %-1$s b" 11)) 207 (should (equal (should-error (format "a %-1$s b" 11))
208 '(error "Invalid format operation %$")))) 208 '(error "Invalid format operation %$")))
209 (should (equal (format "%1$c %1$s" ?±) "± 177")))
209 210
210;;; editfns-tests.el ends here 211;;; editfns-tests.el ends here