Skip to content

Commit

Permalink
Add ert test
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevoke committed Dec 27, 2014
1 parent 1a20720 commit cb48487
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/sqlup-mode-test.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(provide 'sqlup-mode)

;; TODO figure out how to write this
;; (ert-deftest upcase-select ()
;; (with-temp-buffer
;; (sqlup-mode)
;; (insert "select")
;; ;; (execute-kbd-macro (kbd "SPC"))
;; (call-interactively (global-key-binding (kbd "SPC")))
;; (message "|%s|" (buffer-string))
;; (should (equal (buffer-string) "SELECT "))))

(ert-deftest upcase-a-region ()
(with-temp-buffer
(goto-char (point-min))
(insert "select count(*) from 'select' -- select")
(set-mark (point-min))
(call-interactively 'sqlup-capitalize-keywords-in-region)
(should (equal (buffer-string) "SELECT COUNT(*) FROM 'select' -- select"))))

0 comments on commit cb48487

Please sign in to comment.