This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,23 +192,26 @@ mod should { | |
//let e = start.format(ICAL_DATE_FORMAT).to_string(); | ||
assert_eq!( | ||
e, | ||
"BEGIN:VEVENT\nUID:UID_@_test\nDTSTAMP;TZID=Europe/Berlin:20201201T120423\n\ | ||
DTSTART;TZID=Europe/Berlin:20201206T170000\n\ | ||
DURATION:PT2H45M0S\nEND:VEVENT\n" | ||
"BEGIN:VEVENT\r\n\ | ||
UID:UID_@_test\r\n\ | ||
DTSTAMP;TZID=Europe/Berlin:20201201T120423\r\n\ | ||
DTSTART;TZID=Europe/Berlin:20201206T170000\r\n\ | ||
DURATION:PT2H45M0S\r\n\ | ||
END:VEVENT\r\n" | ||
); | ||
} | ||
|
||
#[test] | ||
fn build_whole_day_event() { | ||
use generator::Emitter; | ||
let expect = "BEGIN:VEVENT\n\ | ||
UID:[email protected]\n\ | ||
DTSTAMP:20070423T123432Z\n\ | ||
DTSTART;VALUE=DATE:20070628\n\ | ||
DTEND;VALUE=DATE:20070709\n\ | ||
SUMMARY:Festival International de Jazz de Montreal\n\ | ||
TRANSP:TRANSPARENT\n\ | ||
END:VEVENT\n\ | ||
let expect = "BEGIN:VEVENT\r\n\ | ||
UID:[email protected]\r\n\ | ||
DTSTAMP:20070423T123432Z\r\n\ | ||
DTSTART;VALUE=DATE:20070628\r\n\ | ||
DTEND;VALUE=DATE:20070709\r\n\ | ||
SUMMARY:Festival International de Jazz de Montreal\r\n\ | ||
TRANSP:TRANSPARENT\r\n\ | ||
END:VEVENT\r\n\ | ||
"; | ||
let event = IcalEventBuilder::tzid("America/Montreal") | ||
.uid("[email protected]") | ||
|
@@ -228,16 +231,16 @@ mod should { | |
#[test] | ||
fn build_frequent_ical_event() { | ||
use generator::Emitter; | ||
let expect = "BEGIN:VEVENT\n\ | ||
UID:[email protected]\n\ | ||
DTSTAMP:19970901T130000Z\n\ | ||
DTSTART;VALUE=DATE:19971102\n\ | ||
RRULE:FREQ=YEARLY\n\ | ||
SUMMARY:Our Blissful Anniversary\n\ | ||
TRANSP:TRANSPARENT\n\ | ||
CLASS:CONFIDENTIAL\n\ | ||
CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION\n\ | ||
END:VEVENT\n\ | ||
let expect = "BEGIN:VEVENT\r\n\ | ||
UID:[email protected]\r\n\ | ||
DTSTAMP:19970901T130000Z\r\n\ | ||
DTSTART;VALUE=DATE:19971102\r\n\ | ||
RRULE:FREQ=YEARLY\r\n\ | ||
SUMMARY:Our Blissful Anniversary\r\n\ | ||
TRANSP:TRANSPARENT\r\n\ | ||
CLASS:CONFIDENTIAL\r\n\ | ||
CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION\r\n\ | ||
END:VEVENT\r\n\ | ||
"; | ||
let event = IcalEventBuilder::tzid("America/Montreal") | ||
.uid("[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,24 +173,24 @@ mod should { | |
#[test] | ||
fn build_vcards_wikipedia_example() { | ||
use generator::Emitter; | ||
let expect = "BEGIN:VCARD\n\ | ||
VERSION:4.0\n\ | ||
N:Gump;Forrest;;Mr.;\n\ | ||
FN:Forrest Gump\n\ | ||
ORG:Bubba Gump Shrimp Co.\n\ | ||
TITLE:Shrimp Man\n\ | ||
PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif\n\ | ||
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212\n\ | ||
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212\n\ | ||
ADR;TYPE=WORK;PREF=1;LABEL=\"100 Waters Edge\\nBaytown\\, LA 30314\\nUnited Sta\n \ | ||
tes of America\":;;100 Waters Edge;Baytown;LA;30314;United States of Americ\n \ | ||
a\n\ | ||
ADR;TYPE=HOME;LABEL=\"42 Plantation St.\\nBaytown\\, LA 30314\\nUnited States o\n f \ | ||
America\":;;42 Plantation St.;Baytown;LA;30314;United States of America\n\ | ||
EMAIL:[email protected]\n\ | ||
REV:20080424T195243Z\n\ | ||
x-qq:21588891\n\ | ||
END:VCARD\n\ | ||
let expect = "BEGIN:VCARD\r\n\ | ||
VERSION:4.0\r\n\ | ||
N:Gump;Forrest;;Mr.;\r\n\ | ||
FN:Forrest Gump\r\n\ | ||
ORG:Bubba Gump Shrimp Co.\r\n\ | ||
TITLE:Shrimp Man\r\n\ | ||
PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif\r\n\ | ||
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212\r\n\ | ||
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212\r\n\ | ||
ADR;TYPE=WORK;PREF=1;LABEL=\"100 Waters Edge\\nBaytown\\, LA 30314\\nUnited Sta\r\n \ | ||
tes of America\":;;100 Waters Edge;Baytown;LA;30314;United States of Americ\r\n \ | ||
a\r\n\ | ||
ADR;TYPE=HOME;LABEL=\"42 Plantation St.\\nBaytown\\, LA 30314\\nUnited States o\r\n f \ | ||
America\":;;42 Plantation St.;Baytown;LA;30314;United States of America\r\n\ | ||
EMAIL:[email protected]\r\n\ | ||
REV:20080424T195243Z\r\n\ | ||
x-qq:21588891\r\n\ | ||
END:VCARD\r\n\ | ||
"; | ||
|
||
let vcard = IcalVcardBuilder::version("4.0") | ||
|
@@ -245,12 +245,12 @@ mod should { | |
#[test] | ||
fn build_vcard_with_fn_generated() { | ||
use generator::Emitter; | ||
let expect = "BEGIN:VCARD\n\ | ||
VERSION:4.0\n\ | ||
N:Marx;Adolph;Arthur;Mr.;\n\ | ||
FN:Mr. Adolph Arthur Marx\n\ | ||
NICKNAME:Harpo Marx\n\ | ||
END:VCARD\n\ | ||
let expect = "BEGIN:VCARD\r\n\ | ||
VERSION:4.0\r\n\ | ||
N:Marx;Adolph;Arthur;Mr.;\r\n\ | ||
FN:Mr. Adolph Arthur Marx\r\n\ | ||
NICKNAME:Harpo Marx\r\n\ | ||
END:VCARD\r\n\ | ||
"; | ||
let vcard = IcalVcardBuilder::version("4.0") | ||
.names( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters