diff options
author | Taylor R Campbell <campbell@mumble.net> | 2013-04-07 16:42:41 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@mumble.net> | 2013-04-07 16:42:41 +0000 |
commit | 5840f55909187d671616ef35135f802da5ee609c (patch) | |
tree | 2f934e2e7e424d2713091e1d4c0afa319bd98513 /test.el | |
parent | 18cf19f4d12dbe95b952b895c85579bb41801602 (diff) |
Preserve column better in `paredit-join'.
Diffstat (limited to 'test.el')
-rw-r--r-- | test.el | 138 |
1 files changed, 138 insertions, 0 deletions
@@ -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) |