summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2013-03-09 16:02:40 +0200
committerBozhidar Batsov <bozhidar@tradeo.com>2013-03-09 16:02:40 +0200
commitc054c0ae71f19a13451f27de457b451eae5497ae (patch)
treef0d712e2305117219af1e8b6b3796d03c9383738 /test
parent0bb5ed7486b2bc42edfa53d467fd90e2c3f248bd (diff)
Add a couple of ert tests
Diffstat (limited to 'test')
-rw-r--r--test/nrepl-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/nrepl-tests.el b/test/nrepl-tests.el
index b18a0e93..4c47b392 100644
--- a/test/nrepl-tests.el
+++ b/test/nrepl-tests.el
@@ -135,6 +135,18 @@
(let ((nrepl-hide-special-buffers t))
(should (equal (nrepl-server-buffer-name) " *nrepl-server*"))))
+(ert-deftest test-nrepl-extract-error-line ()
+ (let ((st "this context, compiling:(/some/test/file.clj:20) ala bala"))
+ (should (= (nrepl-extract-error-line st) 20)))
+ (let ((st "this context, compiling:(NO_SOURCE_PATH:20) ala bala"))
+ (should (= (nrepl-extract-error-line st) 20))))
+
+(ert-deftest test-nrepl-extract-error-filename ()
+ (let ((st "this context, compiling:(/some/test/file.clj:20) ala bala"))
+ (should (string= (nrepl-extract-error-filename st) "/some/test/file.clj")))
+ (let ((st "this context, compiling:(NO_SOURCE_PATH:20) ala bala"))
+ (should (string= (nrepl-extract-error-filename st) "NO_SOURCE_PATH"))))
+
(defmacro nrepl-test-with-two-buffers (buffer-names &rest body)
(lexical-let ((create (lambda (b) (list b `(generate-new-buffer " *temp*")))))
`(lexical-let (,@(mapcar create buffer-names))