summaryrefslogtreecommitdiff
path: root/test.el
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@paredit.org>2022-11-26 01:46:42 +0000
committerTaylor R Campbell <campbell@paredit.org>2022-11-26 01:46:42 +0000
commit036684281942343c84612ce63764ad994c752279 (patch)
treea6770e4fbd80dd277e825197b0a7256b0b393446 /test.el
parent928fb082624e6b78040fb1aec9fe82694989d58c (diff)
Teach paredit-forward/backward-kill-word to take prefix argument.
XXX Unlike other paredit commands, C-u is not handled specially -- it is just interpreted as 4. No automatic tests for this at the moment.
Diffstat (limited to 'test.el')
-rw-r--r--test.el68
1 files changed, 43 insertions, 25 deletions
diff --git a/test.el b/test.el
index 8435d87..77850fa 100644
--- a/test.el
+++ b/test.el
@@ -1613,31 +1613,49 @@ Four arguments: the paredit command, the text of the buffer
"\n(f xy\n z\n w)\n;;;|T "
"\n(f xy\n z\n w)\n;;;|T "))))
-(paredit-test 'paredit-forward-kill-word
- '(("|(hello \"world\")"
- "(| \"world\")"
- "( \"|\")"
- error)
- ("(hello| \"world\")"
- "(hello \"|\")")
- ("(hello \"world|\")" error)
- ("(hello \"world\"|)" error)
- ("(hello \"world\")|" error)))
-
-(paredit-test 'paredit-backward-kill-word
- '(("(hello \"world\")|"
- "(hello \"|\")"
- "(|\"\")"
- ;; error or nop -- XXX broken
- )
- ("(hello \"|world\")"
- "(|\"world\")"
- ;; error or nop -- XXX broken
- )
- ("(|hello \"world\")"
- ;; error or nop -- XXX broken
- )
- ("|(hello \"world\")" "|(hello \"world\")")))
+(let ((forward-cases
+ '(("|(hello \"world\")"
+ "(| \"world\")"
+ "( \"|\")"
+ error)
+ ("(hello| \"world\")"
+ "(hello \"|\")")
+ ("(hello \"world|\")" error)
+ ("(hello \"world\"|)" error)
+ ("(hello \"world\")|" error))))
+ (paredit-test 'paredit-forward-kill-word forward-cases)
+ (let ((current-prefix-arg -1))
+ (paredit-test 'paredit-backward-kill-word forward-cases)))
+
+(let ((backward-cases
+ '(("(hello \"world\")|"
+ "(hello \"|\")"
+ "(|\"\")"
+ ;; error or nop -- XXX broken
+ )
+ ("(hello \"|world\")"
+ "(|\"world\")"
+ ;; error or nop -- XXX broken
+ )
+ ("(|hello \"world\")"
+ ;; error or nop -- XXX broken
+ )
+ ("|(hello \"world\")" "|(hello \"world\")"))))
+ (paredit-test 'paredit-backward-kill-word backward-cases)
+ (let ((current-prefix-arg -1))
+ (paredit-test 'paredit-forward-kill-word backward-cases)))
+
+(let ((current-prefix-arg 2))
+ (paredit-test 'paredit-forward-kill-word
+ '((("(foo |bar baz quux)"
+ "(foo | quux)"
+ "(foo |)"
+ "(foo |)"))))
+ (paredit-test 'paredit-backward-kill-word
+ '((("(foo bar baz| quux)"
+ "(foo | quux)"
+ "(| quux)"
+ "(| quux)")))))
(if (> paredit-test-nfailures 0)
(error "%S paredit tests failed" paredit-test-nfailures))