"v1"' 'xml entity unescaping'
if err? r21 [ return r21 ]
r22 = assert-eq (df/xml-child-text svcs[0] 'filter') 'latency_ms < 50 && status == "ok"' 'xml CDATA raw preservation'
if err? r22 [ return r22 ]
// XML render -> parse roundtrip (also testing < non-double-unescape!)
tricky_node = xml/XmlNode {
tag = 'note'
attrs = { 'expr' = 'a < b & "c"' }
children = []
text = 'Literal entity <stays> intact'
}
rendered_xml = df/xml-render/pretty/decl tricky_node true true
reparsed_xml = df/xml-parse rendered_xml
r23 = assert-eq reparsed_xml.text 'Literal entity <stays> intact' 'xml single-pass entity safety'
if err? r23 [ return r23 ]
r24 = assert-eq (df/xml-attr reparsed_xml 'expr' '') 'a < b & "c"' 'xml attribute escape roundtrip'
if err? r24 [ return r24 ]
println ' [PASS] XML 1.0 parser, namespaces, CDATA, numeric refs & serializer roundtrip'
// 3. RSS 2.0 Feed build & parse roundtrip
rss_in = xml/RssChannel {
title = 'Veko Language Releases'
link = 'https://veko-lang.org/releases'
description = 'Official compiler & ecosystem updates'
language = 'en-us'
last_build_date = 'Sat, 05 Dec 2026 01:00:00 GMT'
items = [
(xml/RssItem {
title = 'Veko 1.0.0 Released'
link = 'https://veko-lang.org/releases/1.0.0'
description = '64-bit VKO VM, Wasm 3.0 & Native PE32+/ELF64/Mach-O.'
guid = 'tag:veko-lang.org,2026:1.0.0'
pub_date = 'Sat, 05 Dec 2026 00:00:00 GMT'
author = 'team@veko-lang.org'
categories = ['compiler' 'release']
})
(xml/RssItem {
title = 'Official Ecosystem Packages'
link = 'https://veko-lang.org/pkg'
description = 'Pure-Veko cloud_s3, data_formats, openapi, smtp_mail & webauthn.'
guid = 'tag:veko-lang.org,2026:ecosystem-1'
pub_date = 'Sat, 05 Dec 2026 01:00:00 GMT'
author = 'team@veko-lang.org'
categories = ['packages']
})
]
}
rss_xml = df/build-rss rss_in
rss_out = df/parse-rss rss_xml
if err? rss_out [ return rss_out ]
r25 = assert-eq rss_out.title 'Veko Language Releases' 'rss channel title'
if err? r25 [ return r25 ]
r26 = assert-eq (len rss_out.items) 2 'rss items len'
if err? r26 [ return r26 ]
r27 = assert-eq rss_out.items[0].guid 'tag:veko-lang.org,2026:1.0.0' 'rss item guid'
if err? r27 [ return r27 ]
r28 = assert-eq rss_out.items[0].categories ['compiler' 'release'] 'rss item categories'
if err? r28 [ return r28 ]
println ' [PASS] RSS 2.0 feed codec build & parse roundtrip'
// 4. Atom 1.0 Feed build & parse roundtrip
atom_in = xml/AtomFeed {
id = 'urn:uuid:veko-releases-feed'
title = 'Veko Security & Release Advisories'
updated = '2026-12-05T01:00:00Z'
subtitle = 'Signed VKP1 package advisories'
link = 'https://veko-lang.org/atom.xml'
author_name = 'Veko Core Team'
entries = [
(xml/AtomEntry {
id = 'urn:veko:release:1.0.0'
title = 'Veko 1.0.0 GA'
updated = '2026-12-05T00:00:00Z'
link = 'https://veko-lang.org/releases/1.0.0'
summary = 'General availability across Windows, Linux, macOS, and Wasm.'
content = 'Deterministic single-owner memory & gradual types.
'
author_name = 'Veko Core Team'
})
]
}
atom_xml = df/build-atom atom_in
atom_out = df/parse-atom atom_xml
if err? atom_out [ return atom_out ]
r29 = assert-eq atom_out.id 'urn:uuid:veko-releases-feed' 'atom feed id'
if err? r29 [ return r29 ]
r30 = assert-eq atom_out.author_name 'Veko Core Team' 'atom feed author'
if err? r30 [ return r30 ]
r31 = assert-eq (len atom_out.entries) 1 'atom entries len'
if err? r31 [ return r31 ]
r32 = assert-eq atom_out.entries[0].link 'https://veko-lang.org/releases/1.0.0' 'atom entry link href'
if err? r32 [ return r32 ]
r33 = assert-eq atom_out.entries[0].content 'Deterministic single-owner memory & gradual types.
' 'atom entry HTML content'
if err? r33 [ return r33 ]
println ' [PASS] Atom 1.0 (RFC 4287) feed codec build & parse roundtrip'
println 'ALL data_formats TESTS PASSED'
.ok
]
res = main
if err? res [
println (mold res)
os/exit 1
]