test: Add 20 function-library fixtures incl. repr_* round-trips - #159
Open
leongdl wants to merge 1 commit into
Open
test: Add 20 function-library fixtures incl. repr_* round-trips#159leongdl wants to merge 1 commit into
leongdl wants to merge 1 commit into
Conversation
20 fixtures from the RFC 0006 coverage audit: repr_sh/repr_py/repr_json adversarial round-trips executed through the real target interpreter, repr_cmd/repr_pwsh round-trips (windows-gated), unicode codepoint semantics for len/case/predicates/padding, int64 overflow inside abs/sum/floor/ceil, predicate and conversion edges, and three regex-dialect pins (lookahead, backreference, group-reference rejection per spec 2.2.5). Suite: 350 -> 368 passing. Spec-question fixtures that fail today are split to conformance-func-lib-expected-failures. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
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.
Summary
20 function-library fixtures from a coverage audit of RFC 0006. Suite: EXPR 350 → 368 passing, 0 failing (2 new fixtures are windows-gated and skip on POSIX).
Areas covered
repr_*round-trips — the security-critical surface. The audit found all five pre-existingrepr_*fixtures assert the quoted text as a substring; none executed it. Quoting is only correct if the target interpreter agrees, so these fixtures pipe the quoted output through the real target:repr_shthroughbash(15 adversarial payloads: metacharacters,$(...), backtick, nested quotes, backslash, glob,.., leading-, unicode, empty, whitespace-only),repr_pythroughast.literal_eval(16 payloads),repr_jsonthroughjson.loads(15 payloads) — each asserted byte-identical after the round trip.repr_cmd/repr_pwshround-trips: written and windows-gated (runOn: [windows]); they skip on POSIX and need a Windows CI run to count.%VAR%/!VAR!payloads excluded from the cmd battery per the spec's own.bat-context scoping.lenon CJK/emoji/combining-mark/astral strings; case transforms restricted to 1:1 mappings;isascii/isalphaclassification; padding to codepoint widths.abs(-2^63)rejected (negation overflow),sumoverflow rejected,floor(1e300)/ceil(1e300)rejected,int()at the exact-double 9e18 boundary.isupper("123")/islower("123")false (the "no cased characters" clause), predicates on"",bool("TRUE")/bool("1")case-insensitive forms,range_expr(" ")rejected.re_subreplacements are all rejected by openjd-rs exactly as §2.2.5 requires — but Python'srenatively supports all three, so a naive Python-backed implementation would accept them. These three.invalidfixtures now pin the conservative dialect for every implementation.Deliberately excluded
~160 arity/type error cases (indistinguishable under the current runner, which asserts only a non-zero exit) and ~78 null-argument cases (the spec defines null behaviour for only 6 of 84 functions — a spec decision is needed first). Writing these now would manufacture confidence.
Companion PR
Three parked fixtures with dual-implementation observations (both-implementation
repr_pynewline bug;center()/isdigit()spec gaps where both implementations agree) are in the expected-failures PR (branchconformance-func-lib-expected-failures).