Merge pull request #300 from jolt-lang/corpus/portability-key
Tag every corpus row with :portability (:common vs :jvm)
This commit is contained in:
commit
58ef0c8fa1
3 changed files with 3578 additions and 3571 deletions
7130
test/chez/corpus.edn
7130
test/chez/corpus.edn
File diff suppressed because it is too large
Load diff
|
|
@ -24,11 +24,17 @@ the canonical, frozen contract**: it is what every runtime consumes, what
|
||||||
## Row schema
|
## Row schema
|
||||||
|
|
||||||
```edn
|
```edn
|
||||||
{:suite "numbers / arithmetic" ; grouping; "<suite> :: <label>" is the case id
|
{:suite "numbers / arithmetic" ; grouping; "<suite> :: <label>" is the case id
|
||||||
:label "integer add" ; unique within a suite
|
:label "integer add" ; unique within a suite
|
||||||
:actual "(+ 1 2)" ; Clojure source to evaluate
|
:actual "(+ 1 2)" ; Clojure source to evaluate
|
||||||
:expected "3"} ; Clojure source whose value it must equal,
|
:expected "3" ; Clojure source whose value it must equal,
|
||||||
; or the keyword :throws
|
; or the keyword :throws
|
||||||
|
:portability :common} ; :common = portable Clojure any dialect
|
||||||
|
; must satisfy; :jvm = exercises host
|
||||||
|
; interop (java.*/clojure.lang.* classes,
|
||||||
|
; dot forms, ctors, statics, arrays,
|
||||||
|
; proxy/bean) — skip on a non-JVM-shaped
|
||||||
|
; dialect
|
||||||
```
|
```
|
||||||
|
|
||||||
- `[:suite :label]` is the **canonical, unique case id** (the generator
|
- `[:suite :label]` is the **canonical, unique case id** (the generator
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,12 @@
|
||||||
[row :kept])))
|
[row :kept])))
|
||||||
|
|
||||||
;; --- corpus writer (preserves the one-row-per-line layout) -------------------
|
;; --- corpus writer (preserves the one-row-per-line layout) -------------------
|
||||||
(defn row-str [{:keys [suite label expected actual]}]
|
(defn row-str [{:keys [suite label expected actual portability]}]
|
||||||
(str " {:suite " (pr-str suite)
|
(str " {:suite " (pr-str suite)
|
||||||
" :label " (pr-str label)
|
" :label " (pr-str label)
|
||||||
" :expected " (if (= expected :throws) ":throws" (pr-str expected))
|
" :expected " (if (= expected :throws) ":throws" (pr-str expected))
|
||||||
" :actual " (pr-str actual) "}"))
|
" :actual " (pr-str actual)
|
||||||
|
(when portability (str " :portability " portability)) "}"))
|
||||||
|
|
||||||
(defn -main [& _]
|
(defn -main [& _]
|
||||||
(let [corpus (edn/read-string (slurp corpus-path))
|
(let [corpus (edn/read-string (slurp corpus-path))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue