Skip to content

Commit

Permalink
test(vcard): phone-number escape comma and semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
workgroupengineering committed Oct 17, 2022
1 parent 660b743 commit 95735e5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parse_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ suite('parserv2', function() {
'vcard.vcf',
'vcard_author.vcf',
'vcard3.vcf',
'vcard_grouped.vcf'
'vcard_grouped.vcf',
'escape_semicolon.vcf'
];

list.forEach(function(path) {
Expand Down
26 changes: 26 additions & 0 deletions test/parser/escape_semicolon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
"vcard",
[
[ "version", {}, "text", "3.0" ],
[ "prodid", {}, "text", "-//Sabre//Sabre VObject 4.1.6//EN" ],
[ "uid", {}, "text", "ad612c16-fe12-4ec5-abf6-49998ee5ab88" ],
[ "fn", {}, "text", "First Last NextCloud" ],
[ "adr", { "type": "HOME" }, "text", [ "PO", "Street 2", "Street", "City", "AL", "zip", "Germany" ] ],
[ "adr", { "type": "WORK" }, "text", [ "PO W", "Street 2 W", "Street W", "City Work", "AL work", "zip Work", "Germany work" ] ],
[ "email", { "type": "HOME" }, "text", "home@gmx.de" ],
[ "email", { "type": "WORK" }, "text", "work@gmx.de" ],
[ "tel", { "type": [ "HOME", "VOICE" ] }, "phone-number", "11111111" ],
[ "tel", { "type": "CELL" }, "phone-number", "205333" ],
[ "tel", { "type": ["WORK", "FAX" ] }, "phone-number", "205246;;,;" ],
[ "tel", { "type": ["WORK", "VOICE" ] }, "phone-number", "222222" ],
[ "org", {}, "text", "Firma" ],
[ "bday", {}, "date-time", "2019-02-10T00:00:33" ],
[ "nickname", {}, "text", "Hugo" ],
[ "x-abdate", {"group": "item1"}, "date-and-or-time", "20190220T000035" ],
[ "x-ablabel", {"group": "item1"}, "unknown", "_$!<Anniversary>!$_" ],
[ "x-anniversary", {}, "date-and-or-time", "20190220T000035" ],
[ "categories", {}, "text", "Test-Kontakte" ],
[ "rev", {}, "date-time", "2019-10-08T17:05:14Z" ]
],
[]
]
23 changes: 23 additions & 0 deletions test/parser/escape_semicolon.vcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
UID:ad612c16-fe12-4ec5-abf6-49998ee5ab88
FN:First Last NextCloud
ADR;TYPE=HOME:PO;Street 2;Street;City;AL;zip;Germany
ADR;TYPE=WORK:PO W;Street 2 W;Street W;City Work;AL work;zip Work;Germany w
ork
EMAIL;TYPE=HOME:home@gmx.de
EMAIL;TYPE=WORK:work@gmx.de
TEL;TYPE="HOME,VOICE":11111111
TEL;TYPE=CELL:205333
TEL;TYPE="WORK,FAX":205246\;\;\,\;
TEL;TYPE="WORK,VOICE":222222
ORG:Firma
BDAY:20190210T000033
NICKNAME:Hugo
ITEM1.X-ABDATE;VALUE=DATE-AND-OR-TIME:20190220T000035
ITEM1.X-ABLABEL:_$!<Anniversary>!$_
X-ANNIVERSARY;VALUE=DATE-AND-OR-TIME:20190220T000035
CATEGORIES:Test-Kontakte
REV:20191008T170514Z
END:VCARD

0 comments on commit 95735e5

Please sign in to comment.