summaryrefslogtreecommitdiff
path: root/test.el
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@mumble.net>2013-07-09 20:32:50 +0000
committerTaylor R Campbell <campbell@mumble.net>2013-07-09 20:39:14 +0000
commite0af01a1d55d428c074c8d62b60b99aad17dbbb3 (patch)
treef5627e35068a85b4ec05c70817422e57792c273b /test.el
parent146a43469c968dad01b75aca479c4938d89ee8e4 (diff)
Make slurping and barfing support prefix arguments.
Positive numeric means slurp/barf that many forms. Negative numeric slurp means barf -that many forms, and vice versa. C-u means slurp/barf as many as possible before hitting end of list. Tests are currently pretty limited. Please help!
Diffstat (limited to 'test.el')
-rw-r--r--test.el40
1 files changed, 40 insertions, 0 deletions
diff --git a/test.el b/test.el
index 235fb81..14ef8cc 100644
--- a/test.el
+++ b/test.el
@@ -1337,6 +1337,46 @@ Four arguments: the paredit command, the text of the buffer
("x (\"y\"|)" "(x \"y\"|)")
("x (\"y\")|" error)))
+(let ((current-prefix-arg 2))
+ (paredit-test 'paredit-forward-slurp-sexp
+ '(("(foo|) bar baz" "(foo| bar baz)")))
+ (paredit-test 'paredit-backward-slurp-sexp
+ '(("foo bar (|baz)" "(foo bar |baz)")))
+ (paredit-test 'paredit-forward-barf-sexp
+ '(("(foo| bar baz)" "(foo|) bar baz")
+ ("(foo |bar baz)" "(foo) |bar baz")))
+ (paredit-test 'paredit-backward-barf-sexp
+ '(("(foo bar| baz)" "foo bar| (baz)")
+ ("(foo bar |baz)" "foo bar (|baz)"))))
+
+(let ((current-prefix-arg -2))
+ (paredit-test 'paredit-forward-slurp-sexp
+ '(("(foo| bar baz)" "(foo|) bar baz")
+ ("(foo |bar baz)" "(foo) |bar baz")))
+ (paredit-test 'paredit-backward-slurp-sexp
+ '(("(foo bar| baz)" "foo bar| (baz)")
+ ("(foo bar |baz)" "foo bar (|baz)")))
+ (paredit-test 'paredit-forward-barf-sexp
+ '(("(foo|) bar baz" "(foo| bar baz)")))
+ (paredit-test 'paredit-backward-barf-sexp
+ '(("foo bar (|baz)" "(foo bar |baz)"))))
+
+(let ((current-prefix-arg '(4)))
+ (paredit-test 'paredit-forward-slurp-sexp
+ '(("(foo|) bar baz" "(foo| bar baz)")
+ ("(foo| bar) baz" "(foo| bar baz)")))
+ (paredit-test 'paredit-backward-slurp-sexp
+ '(("foo bar (|baz)" "(foo bar |baz)")
+ ("foo (bar |baz)" "(foo bar |baz)")))
+ (paredit-test 'paredit-forward-barf-sexp
+ '(("(foo| bar baz)" "(foo|) bar baz")
+ ("(foo |bar baz)" "(foo) |bar baz")
+ ("(foo b|ar baz)" "(foo b|ar) baz")))
+ (paredit-test 'paredit-backward-barf-sexp
+ '(("(foo ba|r baz)" "foo (ba|r baz)")
+ ("(foo bar| baz)" "foo bar| (baz)")
+ ("(foo bar |baz)" "foo bar (|baz)"))))
+
(defun paredit-canary-indent-method (state indent-point normal-indent)
(check-parens)
nil)