Permalink
Browse files

Move mods-org tests to test/mods-org-test

  • Loading branch information...
smiller committed Feb 4, 2015
1 parent 1e4d240 commit f49290b31154c1b9d379de0ed155dafa32afb244
Showing with 108 additions and 107 deletions.
  1. +0 −107 mods-org.el
  2. 0 test/.emacs.d-test.el
  3. +108 −0 test/mods-org-test.el
  4. 0 test/test-helper.el
View
@@ -104,110 +104,3 @@
(indent-region (region-beginning) (region-end) 4)
)
)
(ert-deftest test-begin-end-quote-new-content ()
"Tests begin-end-quote without selected region string"
(should (string= (with-temp-buffer
(begin-end-quote)
(buffer-string))
"#+begin_quote\n\n#+end_quote\n")))
(ert-deftest test-begin-end-quote-new-point ()
"Tests begin-end-quote without selected region cursor position"
(should (equal (with-temp-buffer
(begin-end-quote)
(point))
(length "#+begin_quote\n\n"))))
(ert-deftest test-begin-end-verse-new-content ()
"Tests begin-end-verse without selected region string"
(should (string= (with-temp-buffer
(begin-end-verse)
(buffer-string))
"#+begin_verse\n\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-new-point ()
"Tests begin-end-verse without selected region cursor position"
(should (equal (with-temp-buffer
(begin-end-quote)
(point))
(length "#+begin_verse\n\n"))))
(ert-deftest test-begin-end-quote-region ()
"Tests begin-end-quote with selected region"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd;\n")
(set-mark 0)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n Dear Sir, your astonishment’s odd;\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region ()
"Tests begin-end-verse with selected region, two spaces before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd; <br/>\n")
(set-mark 0)
(end-of-buffer)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-region-one-space ()
"Tests begin-end-verse with selected region, one space before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd; <br/>\n")
(set-mark 0)
(end-of-buffer)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-region-no-space ()
"Tests begin-end-verse with selected region, no space before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd;<br/>\n")
(set-mark 0)
(end-of-buffer)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-quote-region-newer-styling ()
"Tests begin-end-quote with selected region, new styling"
(should (string= (with-temp-buffer
(insert " talsernilli barenya-tar falon enyi\n")
(set-mark 0)
(end-of-buffer)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n talsernilli barenya-tar falon enyi\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region-newer-styling ()
"Tests begin-end-verse with selected region, new styling"
(should (string= (with-temp-buffer
(insert " i talessen\n talalor ar-entai kirenyi\n basleth solth sares\n")
(set-mark 0)
(end-of-buffer)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n i talessen\n talalor ar-entai kirenyi\n basleth solth sares\n#+end_verse\n")))
(ert-deftest test-begin-end-quote-region-newer-styling-with-medial-gt ()
"Tests begin-end-quote with selected region, new styling, with > in line"
(should (string= (with-temp-buffer
(insert " count > 42\n")
(set-mark 0)
(end-of-buffer)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n count > 42\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region-newer-styling-with-medial-gt ()
"Tests begin-end-verse with selected region, new styling, with > in line"
(should (string= (with-temp-buffer
(insert " count > 42<br/>\n")
(set-mark 0)
(end-of-buffer)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n count > 42\n#+end_verse\n")))
View
No changes.
View
@@ -0,0 +1,108 @@
(load-file "mods-org.el")
(ert-deftest test-begin-end-quote-new-content ()
"Tests begin-end-quote without selected region string"
(should (string= (with-temp-buffer
(begin-end-quote)
(buffer-string))
"#+begin_quote\n\n#+end_quote\n")))
(ert-deftest test-begin-end-quote-new-point ()
"Tests begin-end-quote without selected region cursor position"
(should (equal (with-temp-buffer
(begin-end-quote)
(point))
(length "#+begin_quote\n\n"))))
(ert-deftest test-begin-end-verse-new-content ()
"Tests begin-end-verse without selected region string"
(should (string= (with-temp-buffer
(begin-end-verse)
(buffer-string))
"#+begin_verse\n\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-new-point ()
"Tests begin-end-verse without selected region cursor position"
(should (equal (with-temp-buffer
(begin-end-quote)
(point))
(length "#+begin_verse\n\n"))))
(ert-deftest test-begin-end-quote-region ()
"Tests begin-end-quote with selected region"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd;\n")
(select-region)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n Dear Sir, your astonishment’s odd;\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region ()
"Tests begin-end-verse with selected region, two spaces before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd; <br/>\n")
(select-region)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-region-one-space ()
"Tests begin-end-verse with selected region, one space before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd; <br/>\n")
(select-region)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-verse-region-no-space ()
"Tests begin-end-verse with selected region, no space before <br/>"
(should (string= (with-temp-buffer
(insert "> Dear Sir, your astonishment’s odd;<br/>\n")
(select-region)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n Dear Sir, your astonishment’s odd;\n#+end_verse\n")))
(ert-deftest test-begin-end-quote-region-newer-styling ()
"Tests begin-end-quote with selected region, new styling"
(should (string= (with-temp-buffer
(insert " talsernilli barenya-tar falon enyi\n")
(select-region)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n talsernilli barenya-tar falon enyi\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region-newer-styling ()
"Tests begin-end-verse with selected region, new styling"
(should (string= (with-temp-buffer
(insert " i talessen\n talalor ar-entai kirenyi\n basleth solth sares\n")
(select-region)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n i talessen\n talalor ar-entai kirenyi\n basleth solth sares\n#+end_verse\n")))
(ert-deftest test-begin-end-quote-region-newer-styling-with-medial-gt ()
"Tests begin-end-quote with selected region, new styling, with > in line"
(should (string= (with-temp-buffer
(insert " count > 42\n")
(select-region)
(begin-end-quote)
(buffer-string))
"#+begin_quote\n count > 42\n#+end_quote\n")))
(ert-deftest test-begin-end-verse-region-newer-styling-with-medial-gt ()
"Tests begin-end-verse with selected region, new styling, with > in line"
(should (string= (with-temp-buffer
(insert " count > 42<br/>\n")
(select-region)
(begin-end-verse)
(buffer-string))
"#+begin_verse\n count > 42\n#+end_verse\n")))
(defun select-region ()
(goto-char (point-min))
(set-mark-command nil)
(goto-char (point-max))
(transient-mark-mode 1)
)
View
No changes.

0 comments on commit f49290b

Please sign in to comment.