+START_TEST (test_derived_address)
+{
+ int i;
+ const gchar *prefix="Re:";
+
+ const StringPair tests[] = {
+ { "subject", "Re: subject" },
+ { NULL, "Re:"},
+ { "Hyvää päivää", "Re: Hyvää päivää"},
+ };
+
+ fail_unless (modest_text_utils_derived_subject (NULL, NULL) == NULL,
+ "modest_text_utils_derived_subject (NULL,NULL) should be NULL");
+
+ for (i = 0; i != sizeof(tests)/sizeof(StringPair); ++i) {
+ gchar *str = g_strdup (tests[i].original);
+ str = modest_text_utils_derived_subject (str, prefix);
+ fail_unless (str && strcmp(str, tests[i].expected) == 0,
+ "modest_text_utils_derived_subject failed for '%s': "
+ "expected '%s' but got '%s'",
+ tests[i].original, tests[i].expected, str);
+ g_free (str);
+ }
+}
+END_TEST
+
+
+
+