diff options
author | Bozhidar Batsov <bozhidar@tradeo.com> | 2013-10-28 16:49:28 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@tradeo.com> | 2013-10-28 16:49:28 +0200 |
commit | 95c9ba376302138bd6335cef39a7904df160e629 (patch) | |
tree | c9f4e69d7f782ad1020c174b845205f74c739269 /test/cider-error-parsing-tests.el | |
parent | 8d2fd330655b0c9b926f6a4ae49be7f8ef512f27 (diff) |
Extract error parsing tests
Diffstat (limited to 'test/cider-error-parsing-tests.el')
-rw-r--r-- | test/cider-error-parsing-tests.el | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/test/cider-error-parsing-tests.el b/test/cider-error-parsing-tests.el new file mode 100644 index 00000000..ca7cbcb2 --- /dev/null +++ b/test/cider-error-parsing-tests.el @@ -0,0 +1,69 @@ +(require 'cider) + +(ert-deftest test-cider-extract-error-info-14 () + (let ((message "CompilerException java.lang.RuntimeException: Unable to resolve symbol: dummy in this context, compiling:(/some/test/file/core.clj:31)")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (string= (nth 0 info) "/some/test/file/core.clj")) + (should (= (nth 1 info) 31)) + (should (equal (nth 2 info) nil)) + (should (equal (nth 3 info) 'cider-error-highlight-face))))) + +(ert-deftest test-cider-extract-error-info-14-no-file () + (let ((message "CompilerException java.lang.RuntimeException: Unable to resolve symbol: dummy in this context, compiling:(NO_SOURCE_PATH:31)")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (equal (nth 0 info) nil)) + (should (= (nth 1 info) 31)) + (should (equal (nth 2 info) nil)) + (should (equal (nth 3 info) 'cider-error-highlight-face))))) + +(ert-deftest test-cider-extract-warning-info-14 () + (let ((message "Reflection warning, /some/othertest/file/core.clj:24 - reference to field getCanonicalPath can't be resolved. +")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (string= (nth 0 info) "/some/othertest/file/core.clj")) + (should (= (nth 1 info) 24)) + (should (equal (nth 2 info) nil)) + (should (equal (nth 3 info) 'cider-warning-highlight-face))))) + +(ert-deftest test-cider-extract-warning-info-14-no-file () + (let ((message "Reflection warning, NO_SOURCE_PATH:24 - reference to field getCanonicalPath can't be resolved. +")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (equal (nth 0 info) nil)) + (should (= (nth 1 info) 24)) + (should (equal (nth 2 info) nil)) + (should (equal (nth 3 info) 'cider-warning-highlight-face))))) + +(ert-deftest test-cider-extract-error-info-15 () + (let ((message "CompilerException java.lang.RuntimeException: Unable to resolve symbol: dummy in this context, compiling:(/some/test/file/core.clj:31:3)")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (string= (nth 0 info) "/some/test/file/core.clj")) + (should (= (nth 1 info) 31)) + (should (= (nth 2 info) 3)) + (should (equal (nth 3 info) 'cider-error-highlight-face))))) + +(ert-deftest test-cider-extract-error-info-15-no-file () + (let ((message "CompilerException java.lang.RuntimeException: Unable to resolve symbol: dummy in this context, compiling:(NO_SOURCE_PATH:31:3)")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (equal (nth 0 info) nil)) + (should (= (nth 1 info) 31)) + (should (= (nth 2 info) 3)) + (should (equal (nth 3 info) 'cider-error-highlight-face))))) + +(ert-deftest test-cider-extract-warning-info-15 () + (let ((message "Reflection warning, /some/othertest/file/core.clj:24:43 - reference to field getCanonicalPath can't be resolved. +")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (string= (nth 0 info) "/some/othertest/file/core.clj")) + (should (= (nth 1 info) 24)) + (should (= (nth 2 info) 43)) + (should (equal (nth 3 info) 'cider-warning-highlight-face))))) + +(ert-deftest test-cider-extract-warning-info-15-no-file () + (let ((message "Reflection warning, NO_SOURCE_PATH:24:43 - reference to field getCanonicalPath can't be resolved. +")) + (let ((info (cider-extract-error-info cider-compilation-regexp message))) + (should (equal (nth 0 info) nil)) + (should (= (nth 1 info) 24)) + (should (= (nth 2 info) 43)) + (should (equal (nth 3 info) 'cider-warning-highlight-face))))) |