summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorniko <niko>2012-10-21 21:56:07 (GMT)
committerniko <niko>2012-10-21 21:56:07 (GMT)
commit3cde36bc0753f9672c46355f661708174ad03b8f (patch)
tree3b74b5d0a0d7ad711a1768c60c945c790e8bb0c4 /test
parent36fa4bd13ea734583d49d38098a216dfdf943744 (diff)
downloadsynckolab-3cde36bc0753f9672c46355f661708174ad03b8f.tar.gz
add uudecoding
Diffstat (limited to 'test')
-rw-r--r--test/synckolab/tools/data/uutest1.eml26
-rw-r--r--test/synckolab/tools/toolsTest.js28
2 files changed, 54 insertions, 0 deletions
diff --git a/test/synckolab/tools/data/uutest1.eml b/test/synckolab/tools/data/uutest1.eml
new file mode 100644
index 0000000..c7475fe
--- /dev/null
+++ b/test/synckolab/tools/data/uutest1.eml
@@ -0,0 +1,26 @@
+Subject: First Name Last Name
+Date: Wed, 10 Oct 2012 15:31:08 +0200
+X-SpamFlt-Status: Not Detected
+X-KASFlt-Status: Status: not_detected
+X-KASFlt-Status: Method: none
+X-KASFlt-Status: Rate: 0
+X-KASFlt-Status: Lua profiles 37653 [Oct 10 2012]
+X-KASFlt-Status: Version: 5.0.1
+X-SpamFlt-Phishing: Not Detected
+X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609
+
+
+begin 666 First Name Last Name.txt
+M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,RXP#0I04D]$240Z+2\O:V5R:6\N8V]M
+M+T-O;G1A8W1S+R].3TY31TU,('8Q+C O+T5.#0I!1%([5%E013U(3TU%.CL[
+M4W1R965T(#%<;E-T<F5E=" R.T-I='D[.WII<&-O9&4[1G)A;F-E#0I%34%)
+M3#M465!%/5!2148Z;6%I;$!M86EL+F-O;0T*5$5,.U194$4]5D])0T4L2$]-
+M13HK,S,@*# I(#,@,3(@,S0@-38@-S@-"E1%3#M465!%/4-%3$PZ*S,S("@P
+M*2 V(#$R(#,T(#4V(#<X#0I/4D<Z0V]M<&%N>3L-"DY/5$4Z3F]T97,@=VET
+M:"!A8V-E;G0@PZG#J,.JPZ -"E@M1DE,12U!4SI,87-T($YA;64L($9I<G-T
+M($YA;64-"DXZ3&%S="!.86UE.T9I<G-T($YA;64[.SL-"D9..D9I<G-T($YA
+M;64@3&%S="!.86UE#0I54DP[5%E013U73U)+.G=E8G-I=&4N8V]M#0I"1$%9
+M.U9!3%5%/41!5$4Z,C Q,C$P,3 -"E5)1#IB9F-A9C-D,"TT8S@U+31C-6,M
+>.31E,BUC835F.65A,60R-C0-"D5.1#I60T%21 T*
+`
+end \ No newline at end of file
diff --git a/test/synckolab/tools/toolsTest.js b/test/synckolab/tools/toolsTest.js
index c534f84..24eff6e 100644
--- a/test/synckolab/tools/toolsTest.js
+++ b/test/synckolab/tools/toolsTest.js
@@ -27,3 +27,31 @@ test("synckolab.Node", function(){
});
+/**
+ * Test uuencoded message
+ */
+test("synckolab.tools.uudecode", function(){
+ var content = readFile("test/synckolab/tools/data/uutest1.eml");
+ content = synckolab.tools.stripMailHeader(content);
+ equal(content.replace(/[\r\n]+/g, " "), ("BEGIN:VCARD " +
+"VERSION:3.0 " +
+"PRODID:-//kerio.com/Contacts//NONSGML v1.0//EN " +
+"ADR;TYPE=HOME:;;Street 1\\nStreet 2;City;;zipcode;France " +
+"EMAIL;TYPE=PREF:mail@mail.com " +
+"TEL;TYPE=VOICE,HOME:+33 (0) 3 12 34 56 78 " +
+"TEL;TYPE=CELL:+33 (0) 6 12 34 56 78 " +
+"ORG:Company; " +
+"NOTE:Notes with accent éèêà " +
+"X-FILE-AS:Last Name, First Name\n" +
+"N:Last Name;First Name;;;\n" +
+"FN:First Name Last Name\n" +
+"URL;TYPE=WORK:website.com\n" +
+"BDAY;VALUE=DATE:20121010\n" +
+"UID:bfcaf3d0-4c85-4c5c-94e2-ca5f9ea1d264\n" +
+"END:VCARD").replace(/\n/g, " "), "uuencoded vcard");
+
+});
+/*
+var content = readFile("test/synckolab/tools/data/uutest1.eml");
+print(synckolab.tools.stripMailHeader(content));
+*/ \ No newline at end of file