Index: src/test/regression.c =================================================================== --- src/test/regression.c (revision 982) +++ src/test/regression.c (working copy) @@ -373,11 +373,11 @@ void test_utf8() { icalproperty *prop; - char *utf8text = "aáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaá"; + char *utf8text = "a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢"; char *test_ical_str_good = "DESCRIPTION:\n" -" aáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaá\n" -" óaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóaáóa\n" -" áóaáóaáóaáóaáóaáóaáóaáóaáóaá\n"; +" a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢\n" +" ¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a\n" +" ¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢¨®a¨¢\n"; prop = icalproperty_new_description(utf8text); @@ -1255,7 +1255,23 @@ icalvalue_free(v); } +void test_tzid_escape(){ + icalparameter *tzid; + icalproperty *prop; + tzid = icalparameter_new_tzid("Timezone\nwith a newline"); + prop = icalproperty_new_dtstart(icaltime_from_day_of_year(26, 2009)); + icalproperty_add_parameter(prop, tzid); + + if (VERBOSE) + printf("%s\n",icalproperty_as_ical_string(prop)); + + is("test encoding of 'Timezone\\nwith a newline'", + icalproperty_as_ical_string(prop), "DTSTART;VALUE=DATE,TZID=Timezone\\nwith a newline:20090126"); + + icalproperty_free(prop); +} + void test_requeststat() { icalproperty *p; @@ -3696,6 +3712,7 @@ test_run("Test classify ", test_classify, do_test, do_header); test_run("Test Iterators", test_iterators, do_test, do_header); test_run("Test strings", test_strings, do_test, do_header); + test_run("Test TZID escaping", test_tzid_escape, do_test, do_header); test_run("Test Compare", test_compare, do_test, do_header); test_run("Create Simple Component", create_simple_component, do_test, do_header); test_run("Create Components", create_new_component, do_test, do_header);