tests/codecs (m-z): comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:53 -05:00
1 parent 98b4ce533e
commit a6732d45f2
23 files changed
+46 -177

No files matched your search

+2 -7
View File
@@ -1,7 +1,5 @@
-- codecs/text/Url + codecs/text/Text tests: every example of RFC 3986 section 5.4 (normal and abnormal), dot-segment removal,
-- splitting, encoding and the location helpers (ported from playlist-luau tests/url.luau); random references against
-- Python's urllib.parse.urljoin; Url.locate / Url.base; Windows-1252 decoding against Python's cp1252 codec; lines,
-- BOM, trim; the fuzz pass. Fixtures: tools/fixtures/playlist.py.
-- codecs/text/Url + Text tests: RFC 3986 5.4 examples, urljoin against Python's urllib, cp1252 against Python.
-- Fixtures: tools/fixtures/playlist.py.
local T = require("@tests/T")
local Url = require("@rosetta/codecs/text/Url")
local Text = require("@rosetta/codecs/text/Text")
@@ -62,13 +60,11 @@ eq(Url.scheme("HTTPS://x"), "https", "scheme lower-cased")
eq(Url.scheme("music/a.mp3"), nil, "relative has no scheme")
-- Python's urljoin
for _, c in Ref do
eq(Url.resolve(c[1], c[2]), c[3], "urljoin " .. c[1] .. " against " .. c[2])
end
t:note("%d random references resolve as urllib.parse.urljoin", #Ref)
-- locate / base
do
local w = {}
local base, scheme = Url.base("https://h/a/list.m3u", w)
@@ -82,7 +78,6 @@ do
t:check(select(2, Url.base("C:\\Music\\l.m3u")) == "windows", "windows base")
end
-- Text
do
for _, c in Cp do
eq(Text.toUtf8("x" .. string.char(c[1]) .. "y"), "x" .. c[2] .. "y", string.format("cp1252 0x%02x", c[1]))