Skip to content

test: golden for Data.String.CodePoints over UTF-8#52

Merged
Unisay merged 1 commit into
mainfrom
issue-36/string-codepoints-golden
Jun 13, 2026
Merged

test: golden for Data.String.CodePoints over UTF-8#52
Unisay merged 1 commit into
mainfrom
issue-36/string-codepoints-golden

Conversation

@Unisay

@Unisay Unisay commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #36.

The final link in the chain that implements Data.String.CodePoints for the Lua backend. Golden.StringCodePoints exercises the now-implemented CodePoints (Unisay/purescript-lua-strings v6.2.0) end to end on a real program: decode (toCodePointArray), code-point length vs byte length, take/drop on code-point boundaries, codePointAt including an astral code point and an out-of-range index, uncons, the encode round-trip (fromCodePointArray <<< toCodePointArray == id), and singleton of an astral code point. The test string mixes UTF-8 widths 1–4 (a, é, Я, 𝐀, z); all output is Int/Bool via fromEnum, so the eval golden stays ASCII and does not depend on how strings are shown.

This is the semantic check for the whole release chain (pslua Char-literal escaping → prelude v7.2.1 Lua 5.1 fixes → strings v6.2.0 CodePoints), run through the actual compiler and Lua interpreter rather than just luacheck.

test/ps moves to package set psc-0.15.15-20260613-2 (strings v6.2.0, prelude v7.2.1). The prelude bump reflows the .spago/.../vX version paths embedded in every golden.ir, and updates Show.lua inside Golden.CharLiterals golden.lua (the Lua 5.1 \a/tostring fixes). No eval golden changed, so existing runtime behaviour is unaffected.

luacheck over generated goldens now also passes --no-redefined: linked library fallbacks reuse a parameter name and shadow an upvalue, which is harmless in generated code — the same rationale as the existing --no-unused.

Add Golden.StringCodePoints exercising the implemented CodePoints
(Unisay/purescript-lua-strings v6.2.0) end to end: decode, length vs
byte length, take/drop on code-point boundaries, codePointAt including
an astral code point, uncons, encode round-trip and singleton. Output
is all Ints/Bools so the eval golden stays ASCII.

Bump test/ps to package set psc-0.15.15-20260613-2 (strings v6.2.0 and
prelude v7.2.1). The prelude bump reflows the version paths embedded in
every golden.ir and updates Show.lua in CharLiterals golden.lua (the
Lua 5.1 fixes); no eval golden changed.

luacheck on generated goldens now also passes --no-redefined: linked
library fallbacks reuse a parameter name and shadow, which is harmless
in generated code (same rationale as the existing --no-unused).
@Unisay Unisay merged commit 6fdc70c into main Jun 13, 2026
1 check passed
@Unisay Unisay deleted the issue-36/string-codepoints-golden branch June 13, 2026 21:08
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.

Data.String.CodePoints in purescript-lua-strings is not implemented

1 participant