|
143 | 143 | (match-string 2 clojure-1.10-compiler-error))
|
144 | 144 | :to-equal "src/haystack/parser.cljc"))))
|
145 | 145 |
|
| 146 | +(describe "cider-clojure-runtime-error-regexp" |
| 147 | + (it "Recognizes a clojure-1.10 runtime error message" |
| 148 | + |
| 149 | + ;; Something like "(ArithmeticException)" will be absent for Exception and RuntimeException in particular |
| 150 | + (let ((specimen "Execution error at foo/foo (src/haystack/parser.cljc:4).")) |
| 151 | + (expect specimen :to-match cider-clojure-runtime-error-regexp) |
| 152 | + (expect (progn |
| 153 | + (string-match cider-clojure-runtime-error-regexp specimen) |
| 154 | + (match-string 2 specimen)) |
| 155 | + :to-equal "src/haystack/parser.cljc")) |
| 156 | + |
| 157 | + (let ((specimen "Execution error (ArithmeticException) at foo/foo (src/haystack/parser.cljc:4).")) |
| 158 | + (expect specimen :to-match cider-clojure-runtime-error-regexp) |
| 159 | + (expect (progn |
| 160 | + (string-match cider-clojure-runtime-error-regexp specimen) |
| 161 | + (match-string 2 specimen)) |
| 162 | + :to-equal "src/haystack/parser.cljc")) |
| 163 | + |
| 164 | + ;; without foo/foo symbol |
| 165 | + (let ((specimen "Execution error at (src/haystack/parser.cljc:4).")) |
| 166 | + (expect specimen :to-match cider-clojure-runtime-error-regexp) |
| 167 | + (expect (progn |
| 168 | + (string-match cider-clojure-runtime-error-regexp specimen) |
| 169 | + (match-string 2 specimen)) |
| 170 | + :to-equal "src/haystack/parser.cljc")) |
| 171 | + |
| 172 | + ;; without foo/foo symbol |
| 173 | + (let ((specimen "Execution error (ArithmeticException) at (src/haystack/parser.cljc:4).")) |
| 174 | + (expect specimen :to-match cider-clojure-runtime-error-regexp) |
| 175 | + (expect (progn |
| 176 | + (string-match cider-clojure-runtime-error-regexp specimen) |
| 177 | + (match-string 2 specimen)) |
| 178 | + :to-equal "src/haystack/parser.cljc"))) |
| 179 | + |
| 180 | + (it "Recognizes a clojure-1.10 runtime spec validation error message" |
| 181 | + (let ((specimen "Execution error - invalid arguments to foo/bar at (src/haystack/parser.cljc:4).")) |
| 182 | + (expect specimen :to-match cider-clojure-runtime-error-regexp) |
| 183 | + (expect (progn |
| 184 | + (string-match cider-clojure-runtime-error-regexp specimen) |
| 185 | + (match-string 2 specimen)) |
| 186 | + :to-equal "src/haystack/parser.cljc")))) |
| 187 | + |
146 | 188 | (describe "cider-module-info-regexp"
|
147 | 189 | (it "Matches module info provided by Java"
|
148 | 190 | (expect " (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IObj is in unnamed module of loader 'app')"
|
|
0 commit comments