-
-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Description
This ticket contains descriptions of issues in the test cases in the Clojure test suite that need to be updated without needing any updates in the jank core.
Issues
1. Parsing errors due to reader conditionals
Due to a missing :jank condition in a reader conditional without a :default case we end up with situations wherein a map has odd entries.
user=> {:key #?(:clj :val)}
─ parse/odd-entries-in-map ─────────────────────────────────────────────────────────────────────────
error: Odd number of entries in map.
The following tests have this error:
-
reduce.
2. case macro expansion
The following error occurs in the case test case.
─ analyze/invalid-case ─────────────────────────────────────────────────────────────────────────────
error: Unable to resolve symbol 'of'.
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ …shantanusardesai/Desktop/code/projects/jank/compiler+runtime/src/jank/clojure/core.jank
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
3929 │ (prep-hashes ge default tests thens #{})]
3930 │ `(let [~ge ~e]
3931 │ (case* ~ge ~shift ~mask ~default ~imap)))
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Consider using the 'case' macro instead of using 'case*' directly.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ clojure-test-suite/test/clojure/core_test/case.cljc
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
8 │ (defn positive-tests
9 │ [x]
10 │ (case x
│ ^ Expanded from this macro.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────
3. short macro expansion
The following error occurs in the short test case.
─ analyze/macro-expansion-exception ────────────────────────────────────────────────────────────────
error: index out of bounds: 2
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ …shantanusardesai/Desktop/code/projects/jank/compiler+runtime/src/jank/clojure/test.jank
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
635 │ ; (fn [] (test-var (var ~name))))
636 │ `(do (def ~name (fn [] (test-var (var ~name))))
637 │ (#'-workaround-set-test (var ~name) (fn [] ~@body)))))
│ ^ Expanded from this macro.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────
─────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ clojure-test-suite/test/clojure/core_test/short.cljc
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
12 │ #?@(:cljs []
13 │ :default
14 │ [(is (instance? #?(:clj java.lang.Short :cljr System.Int16) (short 0)))])
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Found here.
─────┴──────────────────────────────────────────────────────────────────────────────────────────────
4. Unresolvable platform types
Some tests in the test suite default to Clojure in the reader conditional due to which they fail for jank. This could also be due to the fact that jank doesn't yet fully support that concept as of yet.
Ideally these changes should only require changes in the test suite for the :jank reader conditional case but could end up uncovering new issues.
-
abs. -
ancestors. -
assoc. -
assoc-bang. -
bit-clear. -
bit-flip. -
bit-not. -
bit-or. -
bit-set. -
bit-shift-left. -
bit-shift-right. -
bit-test. -
bit-xor. -
byte. -
char. -
conj-bang. -
cons. -
count. -
cycle. -
dec. -
denominator. -
derive. -
double. -
drop. -
drop-last. -
drop-while. -
empty-qmark. -
even-qmark. -
ffirst. -
float. -
fnext. -
gt. -
hash-map. -
inc. -
int. -
intern. -
juxt. -
key. -
keys. -
last. -
long. -
lt. -
lt-eq. -
mapcat. -
max. -
merge. -
min. -
minus. -
mod. -
name. -
namespace. -
neq-qmark. -
nfirst. -
not-empty. -
nth. -
nthnext. -
nthrest. -
num. -
numerator. -
odd-qmark. -
parse-boolean. -
parse-double. -
parse-long. -
parse-uuid. -
partial. -
peek. -
persistent!. -
plus. -
plus-squote. -
pop-bang. -
pos-qmark. -
quot. -
rand-nth. -
random-sample. -
realised-qmark. -
rem. -
repeat. -
reverse. -
rseq. -
select-keys. -
seq. -
set. -
shuffle. -
slash. -
some. -
some-fn. -
sort. -
sort-by. -
star. -
star-squote. -
subs. -
subvec. -
take. -
take-last. -
take-nth. -
taps. -
underive. -
unsigned-bit-shift-right. -
update. -
val. -
vals. -
when-let.
5. Update all exception based tests
Once this PR is merged then the portability namespace in the test suite can be updated with a function to return platform specific exception types which then should be used in the tests. More context can be found in this slack thread.