summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-22 06:54:32 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-22 06:54:32 +0100
commit9480169f1b8a27ed61db0913989c9a81339ccd9d (patch)
treeb04ae101abf03d0baec0da2b2e5156603801efd9 /test
parentd2b86118629562600c07dbc5befa78ac8b860b68 (diff)
downloademacs-9480169f1b8a27ed61db0913989c9a81339ccd9d.tar.gz
Change the string-limit parameter semantics
* lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling convention.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 2e16cd0f30b..52b48095149 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -595,9 +595,10 @@
(ert-deftest subr-string-limit ()
(should (equal (string-limit "foo" 10) "foo"))
(should (equal (string-limit "foo" 2) "fo"))
- (should (equal (string-limit "foo" -2) "oo"))
- (should (equal (string-limit "abc" -10) "abc"))
- (should (equal (string-limit "foo" 0) "")))
+ (should (equal (string-limit "foo" 2 t) "oo"))
+ (should (equal (string-limit "abc" 10 t) "abc"))
+ (should (equal (string-limit "foo" 0) ""))
+ (should-error (string-limit "foo" -1)))
(ert-deftest subr-string-lines ()
(should (equal (string-lines "foo") '("foo")))