summaryrefslogtreecommitdiff
path: root/test.el
diff options
context:
space:
mode:
Diffstat (limited to 'test.el')
-rw-r--r--test.el138
1 files changed, 138 insertions, 0 deletions
diff --git a/test.el b/test.el
index bf9d9bf..a63f70e 100644
--- a/test.el
+++ b/test.el
@@ -863,6 +863,144 @@ Four arguments: the paredit command, the text of the buffer
("#\\|;" "|#\\;" "|#\\;")
("#\\;|" "|#\\;" "|#\\;")))
+(paredit-test 'paredit-join-sexps
+ '(("|ab cd" error)
+ ("a|b cd" error)
+ ("ab| cd" "ab|cd" error)
+ ("ab |cd" "ab|cd" error)
+ ("ab c|d" error)
+ ("ab cd|" error)
+
+ ("|x (y)" error)
+ ("x| (y)" error)
+ ("x |(y)" error)
+ ("x (|y)" error)
+ ("x (y|)" error)
+ ("x (y)|" error)
+
+ ("|(x ((y)\n (z)))" error)
+ ("(|x ((y)\n (z)))" error)
+ ("(x| ((y)\n (z)))" error)
+ ("(x |((y)\n (z)))" error)
+ ("(x (|(y)\n (z)))" error)
+ ("(x ((|y)\n (z)))" error)
+ ("(x ((y)|\n (z)))" "(x ((y|\n z)))")
+ ("(x ((y)\n| (z)))" "(x ((y\n| z)))")
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))")
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))")
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))")
+ ;++ I don't think this is right. The point shouldn't move right.
+ ("(x ((y)\n |(z)))" "(x ((y\n |z)))")
+ ("(x ((y)\n (|z)))" error)
+ ("(x ((y)\n (z|)))" error)
+ ("(x ((y)\n (z)|))" error)
+ ("(x ((y)\n (z))|)" error)
+ ("(x ((y)\n (z)))|" error)
+
+ ("|(ab cd) (ef \"gh\")" error)
+ ("(|ab cd) (ef \"gh\")" error)
+ ("(a|b cd) (ef \"gh\")" error)
+ ("(ab| cd) (ef \"gh\")" "(ab|cd) (ef \"gh\")" error)
+ ("(ab |cd) (ef \"gh\")" "(ab|cd) (ef \"gh\")" error)
+ ("(ab c|d) (ef \"gh\")" error)
+ ("(ab cd|) (ef \"gh\")" error)
+ ("(ab cd)| (ef \"gh\")" "(ab cd| ef \"gh\")" "(ab cd|ef \"gh\")" error)
+ ("(ab cd) |(ef \"gh\")" "(ab cd |ef \"gh\")" "(ab cd|ef \"gh\")" error)
+ ("(ab cd) (|ef \"gh\")" error)
+ ("(ab cd) (e|f \"gh\")" error)
+ ("(ab cd) (ef| \"gh\")" error)
+ ("(ab cd) (ef |\"gh\")" error)
+ ("(ab cd) (ef \"g|h\")" error)
+ ("(ab cd) (ef \"gh\"|)" error)
+ ("(ab cd) (ef \"gh\")|" error)
+
+ ("|() \"\"" error)
+ ("(|) \"\"" error)
+ ("()| \"\"" error)
+ ("() |\"\"" error)
+ ("() \"|\"" error)
+ ("() \"\"|" error)
+
+ ("|\"\" ()" error)
+ ("\"|\" ()" error)
+ ("\"\"| ()" error)
+ ("\"\" |()" error)
+ ("\"\" (|)" error)
+ ("\"\" (|)|" error)
+
+ ("|(x y) [z]" error)
+ ("(|x y) [z]" error)
+ ("(x| y) [z]" "(x|y) [z]" error)
+ ("(x |y) [z]" "(x|y) [z]" error)
+ ("(x y|) [z]" error)
+ ("(x y)| [z]" error)
+ ("(x y) |[z]" error)
+ ("(x y) [|z]" error)
+ ("(x y) [z|]" error)
+ ("(x y) [z]|" error)
+
+ ("|(x)(y)" error)
+ ("(|x)(y)" error)
+ ("(x|)(y)" error)
+ ("(x)|(y)" "(x| y)")
+ ("(x)(|y)" error)
+ ("(x)(y|)" error)
+ ("(x)(y)|" error)
+
+ ("|\"ab\" \"cd\"" error)
+ ("\"|ab\" \"cd\"" error)
+ ("\"a|b\" \"cd\"" error)
+ ("\"ab\"| \"cd\"" "\"ab|cd\"" error)
+ ("\"ab\" | \"cd\"" "\"ab|cd\"" error)
+ ("\"ab\" |\"cd\"" "\"ab|cd\"" error)
+ ("\"ab\" \"|cd\"" error)
+ ("\"ab\" \"c|d\"" error)
+ ("\"ab\" \"cd|\"" error)
+ ("\"ab\" \"cd\"|" error)
+
+ ("|(x ((y)\n (z)))" error)
+ ("(|x ((y)\n (z)))" error)
+ ("(x| ((y)\n (z)))" error)
+ ("(x |((y)\n (z)))" error)
+ ("(x ((|y)\n (z)))" error)
+ ("(x ((y)|\n (z)))" "(x ((y|\n z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n| (z)))" "(x ((y\n| z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n | (z)))" "(x ((y\n | z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n |(z)))" "(x ((y\n |z)))" "(x ((y|z)))" error)
+ ("(x ((y)\n (|z)))" error)
+ ("(x ((y)\n (z|)))" error)
+ ("(x ((y)\n (z)|))" error)
+ ("(x ((y)\n (z))|)" error)
+ ("(x ((y)\n (z)))|" error)
+
+ ;++ What about comments intervening strings/symbols?
+ ("|((x) ;c\n (y))" error)
+ ("(|(x) ;c\n (y))" error)
+ ("((|x) ;c\n (y))" error)
+ ("((x|) ;c\n (y))" error)
+ ("((x)| ;c\n (y))"
+ "((x| ;c\n y))")
+ ("((x) | ;c\n (y))"
+ "((x | ;c\n y))")
+ ("((x) | ;c\n (y))"
+ "((x | ;c\n y))")
+ ("((x) | ;c\n (y))"
+ "((x | ;c\n y))")
+ ("((x) |;c\n (y))"
+ "((x |;c\n y))")
+ ("((x) ;|c\n (y))" error)
+ ("((x) ;c|\n (y))" error)
+ ("((x) ;c\n| (y))"
+ "((x ;c\n| y))")
+ ("((x) ;c\n |(y))"
+ "((x ;c\n |y))")
+ ("((x) ;c\n (|y))" error)
+ ("((x) ;c\n (y|))" error)
+ ("((x) ;c\n (y)|)" error)
+ ("((x) ;c\n (y))|" error)))
+
(defun paredit-canary-indent-method (state indent-point normal-indent)
(check-parens)
nil)