Clojure-Intro-Course / clojure-intro-class

NOTE: This repository is obsolete. Was: A pilot project to use Clojure for introductory computer science courses at the University of Minnesota - Morris
20 stars 3 forks source link

Filter stacktrace for spec errors #112

Open elenam opened 8 years ago

elenam commented 8 years ago

Here is an example of a stacktrace:

Error: In function +, the second argument {:a +, :b [+ -], :c {:a +}} must be a number but is a map.
Found in file test.clj on, or before, line 10 in function eval9148.
    clojure.core/ex-info (core.clj line 4706)
    clojure.spec/spec-checking-fn (spec.clj line 545)
    clojure.spec/spec-checking-fn (spec.clj line 553)
    clojure.core/apply (core.clj line 651)
    clojure.core/apply (core.clj line 646)
    corefns.corefns/+ (corefns.clj line 281)
    corefns.corefns/+ (corefns.clj line 280)
    intro.test/eval9148 (test.clj line 10)
    intro.test/eval9148 (test.clj line 10)
    intro.core/-main (core.clj line 17)
    intro.core/-main (core.clj line 12)
elenam commented 8 years ago

There seem to be duplicated lines.

elenam commented 8 years ago

apply is above +, so perhaps we can filter it out? There are two copies of +, presumably one of them refers to spec instrumentation. There are two lines for main, not sure why.