summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@mumble.net>2013-04-07 16:26:44 +0000
committerTaylor R Campbell <campbell@mumble.net>2013-04-07 16:26:44 +0000
commit427d8e1f74e828cb0e9231f1a224fdcd40afde05 (patch)
tree2135805bb17183ab2fafd2f1af8ebae00ab54d26
parentf25cd3bc40865d2a61485a556e1041eff3e28892 (diff)
Add a pile of `paredit-backward-barf-sexp' tests.
Still need forward barfage tests, and any slurpage tests.
-rw-r--r--test.el113
1 files changed, 113 insertions, 0 deletions
diff --git a/test.el b/test.el
index f99cd9a..7d12283 100644
--- a/test.el
+++ b/test.el
@@ -625,6 +625,119 @@ Four arguments: the paredit command, the text of the buffer
(";f\n(b\n |z)\n" ";f\n(b\n |)\n" ";f\n(b\n |)\n")
(";f\n(b\n z|)\n" ";f\n(b\n z|)\n")))
+(paredit-test 'paredit-backward-barf-sexp
+ '(("|(fo)" error)
+ ;++ I think these are wrong. There should be a space.
+ ("(|fo)" "|fo()" error)
+ ("(f|o)" "f|o()" error)
+ ("(fo|)" "fo(|)" "fo(|)")
+ ("(fo)|" error)
+
+ ("|(fo (ba bz qx) zt)" error)
+ ("(|fo (ba bz qx) zt)" "|fo ((ba bz qx) zt)" error)
+ ("(f|o (ba bz qx) zt)" "f|o ((ba bz qx) zt)" error)
+ ("(fo| (ba bz qx) zt)" "fo| ((ba bz qx) zt)" error)
+ ("(fo |(ba bz qx) zt)"
+ "fo (|(ba bz qx) zt)"
+ "fo |(ba bz qx) (zt)"
+ error)
+ ("(fo (|ba bz qx) zt)"
+ "(fo |ba (bz qx) zt)"
+ "fo (|ba (bz qx) zt)"
+ "fo |ba ((bz qx) zt)"
+ error)
+ ("(fo (b|a bz qx) zt)"
+ "(fo b|a (bz qx) zt)"
+ "fo (b|a (bz qx) zt)"
+ "fo b|a ((bz qx) zt)"
+ error)
+ ("(fo (ba| bz qx) zt)"
+ "(fo ba| (bz qx) zt)"
+ "fo (ba| (bz qx) zt)"
+ "fo ba| ((bz qx) zt)"
+ error)
+ ("(fo (ba |bz qx) zt)"
+ "(fo ba (|bz qx) zt)"
+ "(fo ba |bz (qx) zt)"
+ "fo (ba |bz (qx) zt)"
+ "fo ba (|bz (qx) zt)"
+ "fo ba |bz ((qx) zt)"
+ error)
+ ("(fo (ba b|z qx) zt)"
+ "(fo ba (b|z qx) zt)"
+ "(fo ba b|z (qx) zt)"
+ "fo (ba b|z (qx) zt)"
+ "fo ba (b|z (qx) zt)"
+ "fo ba b|z ((qx) zt)"
+ error)
+ ("(fo (ba bz| qx) zt)"
+ "(fo ba (bz| qx) zt)"
+ "(fo ba bz| (qx) zt)"
+ "fo (ba bz| (qx) zt)"
+ "fo ba (bz| (qx) zt)"
+ "fo ba bz| ((qx) zt)"
+ error)
+
+ ("(fo (ba bz |qx) zt)"
+ "(fo ba (bz |qx) zt)"
+ "(fo ba bz (|qx) zt)"
+ "(fo ba bz |qx() zt)" ;++ Should have a space.
+ "fo (ba bz |qx() zt)"
+ "fo ba (bz |qx() zt)"
+ "fo ba bz (|qx() zt)"
+ "fo ba bz |qx(() zt)"
+ error)
+ ("(fo (ba bz |qx) zt)"
+ "(fo ba (bz |qx) zt)"
+ "(fo ba bz (|qx) zt)"
+ "(fo ba bz |qx() zt)"
+ "fo (ba bz |qx() zt)"
+ "fo ba (bz |qx() zt)"
+ "fo ba bz (|qx() zt)"
+ "fo ba bz |qx(() zt)"
+ error)
+ ("(fo (ba bz q|x) zt)"
+ "(fo ba (bz q|x) zt)"
+ "(fo ba bz (q|x) zt)"
+ "(fo ba bz q|x() zt)"
+ "fo (ba bz q|x() zt)"
+ "fo ba (bz q|x() zt)"
+ "fo ba bz (q|x() zt)"
+ "fo ba bz q|x(() zt)"
+ error)
+ ("(fo (ba bz qx|) zt)"
+ "(fo ba (bz qx|) zt)"
+ "(fo ba bz (qx|) zt)"
+ "(fo ba bz qx(|) zt)"
+ "(fo ba bz qx(|) zt)")
+ ("(fo (ba bz qx)| zt)"
+ "fo ((ba bz qx)| zt)"
+ "fo (ba bz qx)| (zt)"
+ error)
+ ("(fo (ba bz qx) |zt)"
+ "fo ((ba bz qx) |zt)"
+ "fo (ba bz qx) (|zt)"
+ "fo (ba bz qx) |zt()"
+ error)
+ ("(fo (ba bz qx) z|t)"
+ "fo ((ba bz qx) z|t)"
+ "fo (ba bz qx) (z|t)"
+ "fo (ba bz qx) z|t()"
+ error)
+ ("(fo (ba bz qx) zt|)"
+ "fo ((ba bz qx) zt|)"
+ "fo (ba bz qx) (zt|)"
+ "fo (ba bz qx) zt(|)"
+ "fo (ba bz qx) zt(|)")
+ ("(fo (ba bz qx) zt)|" error)
+
+ ;++ Test interaction with comments...
+
+ ("\"|\"" error)
+ ("\"|xy\"" error) ;++ Could be done. Why not?
+ ("\"x|y\"" error)
+ ("\"xy|\"" error)))
+
(defun paredit-canary-indent-method (state indent-point normal-indent)
(check-parens)
nil)