]> code.delx.au - gnu-emacs-elpa/commitdiff
tiny-test.el: added a test for `tiny-replace-this-sexp'
authoroleh <wave@mail.ua>
Mon, 7 Oct 2013 19:30:34 +0000 (21:30 +0200)
committeroleh <wave@mail.ua>
Mon, 7 Oct 2013 19:30:34 +0000 (21:30 +0200)
tiny-test.el

index 2350724b2f5f5e8190acd9418ddd7424a9ba1f43..07667f85e1aec3516b01b8e2dab8811910cea1a8 100644 (file)
@@ -140,6 +140,14 @@ SCHEDULED: <2013-11-25 Mon> DEADLINE: <2013-12-02 Mon>
 SCHEDULED: <2013-12-02 Mon> DEADLINE: <2013-12-09 Mon>"
                  )))
 
+(ert-deftest tiny-replace-this-sexp ()
+  (should (equal (with-text-value "(mapcar (lambda (x) (* x x)) '(1 2 3))"
+                   (lambda()(goto-char 16)(tiny-replace-this-sexp)(buffer-string)))
+                 "(1 4 9)"))
+  (should (equal (with-text-value "(mapcar (lambda (x) (* x x)) '(1 2 3))"
+                   (lambda()(goto-char 2)(tiny-replace-this-sexp)(buffer-string)))
+                 "(1 4 9)")))
+
 (ert-deftest tiny-tokenize ()
     (should (equal (tiny-tokenize "stringxx") "(string x x)"))
     (should (equal (tiny-tokenize "*2+xxx") "(* 2 (+ x x x))"))