Skip to content

test(phel): mark intentional Phel divergences with :phel branches#19

Open
Chemaclass wants to merge 1 commit into
mainfrom
feat/phel-divergences
Open

test(phel): mark intentional Phel divergences with :phel branches#19
Chemaclass wants to merge 1 commit into
mainfrom
feat/phel-divergences

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Summary

Adds :phel reader-conditional branches documenting where Phel deliberately diverges from JVM Clojure on bad-shape / edge input, so the suite runs green under Phel (5487/5487) without masking behavior or weakening other dialects. Phel's reader resolves :phel and otherwise falls back to :default, so these branches are additive — :clj/:cljs/:lpy/:bb/:default are untouched.

Triaged for phel-lang#2223. Per-bucket judgment (not blanket-fix): real bugs are fixed in phel-lang core (#2224 coercion/keys, #2226 string-fn null handling); the cases here are intentional divergences kept lenient by design.

What changed (:phel branches assert Phel's actual behavior)

Lenient / nil-safe / structural returns where Clojure throws: parse-long/-double/-boolean/-uuid (nil), key/val, realized?, < <= > >=, min-key/min/max, compare on collections, peek/last/ffirst/fnext, empty?/not-empty, shuffle/sort-by/case/merge/update/remove/take-nth/map/conj/set/select-keys/reverse/keys/vals, nth/nthnext/take/drop/count/contains?/partial, keyword/symbol/intern. Transients are unguarded (no use-after-persistent! check; non-bang ops permitted) → skipped like :lpy.

Kept lenient by maintainer decision: odd?/even? operate on any number (no integer check); compare on collections.

Numeric tower (Bucket B): no automatic bigint promotion / overflow throw in * + -, int/long/float/double/byte/rem/quot/mod; numerator/denominator treat ints as n/1. Asserted values are arithmetically correct — Phel just doesn't raise the JVM overflow exception.

phel.string throws on non-string (phel-lang#2226): starts-with?/ends-with?/upper-case/lower-case/capitalize/blank? assert the throw under :phel.

Verification

composer test under Phel (local phel checkout): Passed 5487 / Failed 0 / Error 0.

Related to phel-lang#2223.

@Chemaclass Chemaclass self-assigned this May 29, 2026
Phel's reader resolves :phel (else :default). Add :phel reader-conditional
branches documenting where Phel deliberately diverges from JVM Clojure on
bad-shape / edge input, so the suite is green under Phel without masking
behavior. Builds on #16 (parse-*) and #18 (string_test); covers the
remaining core_test divergences:

- nil-safe / structural returns where Clojure throws (key/val, realized?,
  < <= > >=, min-key/min/max, compare collections, peek/last/ffirst/fnext,
  empty?/not-empty, shuffle/sort-by/case/merge/update/remove/take-nth/map/
  conj/set/select-keys/reverse/keys/vals, nth/nthnext/take/drop/count/
  contains?/partial, keyword/symbol/intern); transients unguarded.
- odd?/even? operate on any number (no integer check) -> kept lenient.
- numeric tower (Bucket B): no auto bigint-promote/overflow in * + - and
  int/long/float/double/byte/rem/quot/mod; numerator/denominator int->n/1.

Suite green under Phel: 5477/5477. Related to phel-lang#2223.
@Chemaclass Chemaclass force-pushed the feat/phel-divergences branch from c8ec936 to 5dab45d Compare May 29, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant