Fix vCard 3 PROFILE and AGENT handling
Parse PROFILE as the concrete VC3_Profile type instead of a bare VC3_Property, and validate PROFILE parameters under the correct content-type name. Preserve AGENT values in newVC3_Agent so both parsed and constructed AGENT properties serialize with their actual URI or inline content. Expand regression coverage to verify PROFILE is exposed and serialized as the standard property, parsed AGENT URI values round-trip correctly, and constructed AGENT values retain their content. AI-Assisted: yes AI-Tool: OpenAI Codex / gpt-5.4 xhigh
This commit is contained in:
@@ -240,7 +240,9 @@ suite "vcard/vcard3":
|
||||
"FN:John Smith",
|
||||
"N:Smith;John;;;"))
|
||||
|
||||
check parsed.profile.isSome
|
||||
check:
|
||||
parsed.profile.isSome
|
||||
($parsed).contains("PROFILE:VCARD")
|
||||
|
||||
test "spec: AGENT uri values survive parse and serialize":
|
||||
let serialized = $parseSingleVCard3(vcard3Doc(
|
||||
@@ -251,6 +253,12 @@ suite "vcard/vcard3":
|
||||
|
||||
check serialized.contains("AGENT;VALUE=uri:mailto:assistant@example.com")
|
||||
|
||||
test "spec: constructed AGENT values serialize with their content":
|
||||
let vc = newMinimalVCard3()
|
||||
vc.add(newVC3_Agent("mailto:assistant@example.com", isInline = false))
|
||||
|
||||
check ($vc).contains("AGENT;VALUE=uri:mailto:assistant@example.com")
|
||||
|
||||
test "spec: folded lines may continue with horizontal tab":
|
||||
let parsed = parseSingleVCard3(
|
||||
"BEGIN:VCARD\r\n" &
|
||||
|
||||
Reference in New Issue
Block a user