test(phel): mark lenient core-fn divergences (suite green under Phel)#900
Closed
Chemaclass wants to merge 4 commits into
Closed
test(phel): mark lenient core-fn divergences (suite green under Phel)#900Chemaclass wants to merge 4 commits into
Chemaclass wants to merge 4 commits into
Conversation
Phel's parse-long / parse-double / parse-boolean / parse-uuid intentionally return nil for non-string (or unparseable) input instead of throwing, so they chain in when/if-let without guarding. Add :phel branches to the exception blocks asserting nil-return instead of p/thrown?, documenting the difference. Other dialects are unaffected (they fall through to their existing branches).
v0.40.0 release predates the phel.test/assert-expr signature change (arg order flipped to [message form], dispatch on 2nd arg) that the suite's portability p/thrown? shim depends on, so the tag fails to compile string/core tests. Pin dev-main to match the nightly CI target.
Phel's string functions are strict: a non-string argument throws instead of being coerced via str/toString (the JVM :default behaviour). Add :phel branches asserting the throw for upper-case / lower-case / capitalize / starts-with? / ends-with? (mirroring the :cljs/:lpy/:cljr stance). blank? gets a :phel branch for \space, which Phel reads as the space string " " (blank? => true) rather than a character type.
Phel is intentionally lenient where Clojure throws on bad-type input (nil-punning DX): predicates/arith/collection fns return a value (nil/false/0/identity) or coerce instead of throwing. Add :phel reader conditional branches asserting Phel's actual behavior, mirroring the existing :cljs/:lpy/:cljr stance and the parse-*/string divergence commits. Other dialects' branches are untouched. Also drop a stale :phel marker in repeatedly (Phel now matches :default for mid-failure side effects). Brings the phel run of the suite to 0 failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
:phelreader-conditional branches across 71 core-test namespaces so the suite runs 0 failures under Phel (was 209).Phel is intentionally lenient where Clojure throws on bad-type input (nil-punning DX): predicates, arithmetic, and collection fns return a value (
nil/false/0/identity) or coerce the argument instead of throwing. Each:phelbranch asserts Phel's actual behavior, with a;;comment documenting the divergence, mirroring the existing:cljs/:lpy/:cljrstance and the priorparse-*/ string-strict divergence commits (#16, #18).Other dialects' branches (
:default/:clj/:cljs/:lpy/:cljr) are untouched — every restructured assertion keeps its original form under:default.Categories marked
key/val/keys/vals/peek/empty?/not-empty/realized?/min-key/select-keys/descendants/contains?etc. returnnil/falseinstead of throwing.even?/odd?/zero?/pos?/neg?/</<=/>/>=/quot/rem/mod/min/maxcoercenil→0 or follow PHP/IEEE float semantics instead of throwing.+/-/*///int/long/bytesilently promote on overflow (no BigInt throw).\ais a 1-char string, somap/count/reverse/fnext/ffirst/set/lasttreat it as a seqable.*!afterpersistent!don't throw (see flags below).repeatedlymid-failure now matches:default.Notes for Phel-side follow-up (flagged, not blocking)
Marked as
:phelto keep the suite green, but worth deciding whether Phel should tighten:casewith no matching clause and no default returnsnilinstead of erroring (arguable semantic gap).SequenceGenerator::toIterable()TypeError,is_nan()deprecation) rather than clean Phel errors.Result