Add string-chop-newline
* doc/lispref/strings.texi (Creating Strings): Document it. * lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.
This commit is contained in:
parent
e967ba3018
commit
f329a3180e
5 changed files with 16 additions and 1 deletions
|
@ -615,5 +615,10 @@
|
|||
(should (equal (string-pad "foo" -5 ?-) "--foo"))
|
||||
(should (equal (string-pad "foo" 2 ?-) "foo")))
|
||||
|
||||
(ert-deftest subr-string-chop-newline ()
|
||||
(should (equal (string-chop-newline "foo\n") "foo"))
|
||||
(should (equal (string-chop-newline "foo\nbar\n") "foo\nbar"))
|
||||
(should (equal (string-chop-newline "foo\nbar") "foo\nbar")))
|
||||
|
||||
(provide 'subr-x-tests)
|
||||
;;; subr-x-tests.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue