diff options
author | niko <niko> | 2012-10-26 14:46:03 (GMT) |
---|---|---|
committer | niko <niko> | 2012-10-26 14:46:03 (GMT) |
commit | 3ce6a3cf783d624c84e0a05a6a03310ad43c6e9a (patch) | |
tree | 3456f29001536e2eb8b13c40ff2713a8340ff884 /test/synckolab | |
parent | cbcc1d1672fd98e4088f6274d40daf2b74eb1eac (diff) | |
download | synckolab-3ce6a3cf783d624c84e0a05a6a03310ad43c6e9a.tar.gz |
test quoted decoding
Diffstat (limited to 'test/synckolab')
-rw-r--r-- | test/synckolab/tools/data/quotedtest1.eml | 24 | ||||
-rw-r--r-- | test/synckolab/tools/toolsTest.js | 23 |
2 files changed, 46 insertions, 1 deletions
diff --git a/test/synckolab/tools/data/quotedtest1.eml b/test/synckolab/tools/data/quotedtest1.eml new file mode 100644 index 0000000..2ced3e0 --- /dev/null +++ b/test/synckolab/tools/data/quotedtest1.eml @@ -0,0 +1,24 @@ +From: test@no.com +Reply-To: +Bcc: +To: synckolab@no.tld +Subject: iCal bcf938ec-c5ce-49a9-bb89-5c5442c87415 +Date: Thu, 3 May 2007 12:22:32 +0200 +Content-Type: text/calendar; + charset="utf-8" +Content-Transfer-Encoding: quoted-printable +User-Agent: SyncKolab 0.4.33 + +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20121026T122145Z +LAST-MODIFIED:20121026T122205Z +DTSTAMP:20121026T122205Z +UID:19a700e7-c207-4e7c-a212-6831dbfbb0fc +SUMMARY:test +DTSTART;TZID=3DEurope/Rome:20121027T140000 +DTEND;TZID=3DEurope/Rome:20121027T150000 +END:VEVENT +END:VCALENDAR diff --git a/test/synckolab/tools/toolsTest.js b/test/synckolab/tools/toolsTest.js index b58f210..7d4770c 100644 --- a/test/synckolab/tools/toolsTest.js +++ b/test/synckolab/tools/toolsTest.js @@ -49,8 +49,29 @@ test("synckolab.tools.uudecode", function(){ "BDAY;VALUE=DATE:20121010\n" + "UID:bfcaf3d0-4c85-4c5c-94e2-ca5f9ea1d264\n" + "END:VCARD").replace(/\n/g, " "), "uuencoded vcard"); - }); + +/** + * Test encoded message + */ +test("synckolab.tools.quoteddecode", function(){ + var message = readFile("test/synckolab/tools/data/quotedtest1.eml"); + message = synckolab.tools.stripMailHeader(message); + equal(message.content.replace(/[ \r\n]+/g, ""), ("BEGIN:VCALENDAR" + +"PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN " + +"VERSION:2.0 " + +"BEGIN:VEVENT " + +"CREATED:20121026T122145Z " + +"LAST-MODIFIED:20121026T122205Z " + +"DTSTAMP:20121026T122205Z " + +"UID:19a700e7-c207-4e7c-a212-6831dbfbb0fc " + +"SUMMARY:test " + +"DTSTART;TZID=Europe/Rome:20121027T140000 " + +"DTEND;TZID=Europe/Rome:20121027T150000 " + +"END:VEVENT " + +"END:VCALENDAR").replace(/[ \n]/g, ""), "quoted encoded vcard"); +}); + /* var content = readFile("test/synckolab/tools/data/uutest1.eml"); print(synckolab.tools.stripMailHeader(content)); |