ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #00424
[Branch ~notify-osd-developers/notify-osd/main] Rev 405: forgot to add updated unit-test for extended text-filtering functions
------------------------------------------------------------
revno: 405
committer: Mirco Müller <mirco.mueller@xxxxxxxxxx>
branch nick: notify-osd
timestamp: Thu 2009-10-01 10:43:26 +0200
message:
forgot to add updated unit-test for extended text-filtering functions
modified:
tests/test-text-filtering.c
--
lp:notify-osd
https://code.launchpad.net/~notify-osd-developers/notify-osd/main
Your team ayatana-commits is subscribed to branch lp:notify-osd.
To unsubscribe from this branch go to https://code.launchpad.net/~notify-osd-developers/notify-osd/main/+edit-subscription.
=== modified file 'tests/test-text-filtering.c'
--- tests/test-text-filtering.c 2009-08-10 09:36:02 +0000
+++ tests/test-text-filtering.c 2009-10-01 08:43:26 +0000
@@ -69,8 +69,8 @@
{ "<tt>Testing tag</tt>", "Testing tag" },
{ "<html>Surrounded by html</html>", "Surrounded by html" },
{ "<qt>Surrounded by qt</qt>", "Surrounded by qt" },
- { "First line <br dumb> \r \n Second line", "First line\nSecond line" },
- { "First line\n<br /> <br>\n2nd line\r\n3rd line", "First line\n2nd line\n3rd line" },
+ { "First line <br dumb> \r \n Second line", "First line Second line" },
+ { "First line\n<br /> <br>\n2nd line\r\n3rd line", "First line 2nd line 3rd line" },
{ NULL, NULL }
};
@@ -81,6 +81,22 @@
}
}
+static void
+test_newline_to_space ()
+{
+ static const TextComparisons tests[] = {
+ { "one\ntwo\nthree\nfour\nfive\nsix", "one two three four five six" },
+ { "1\n2\n3\n4\n5\n6", "1 2 3 4 5 6" },
+ { NULL, NULL }
+ };
+
+ for (int i = 0; tests[i].before != NULL; i++) {
+ char *filtered = newline_to_space (tests[i].before);
+ g_assert_cmpstr (filtered, ==, tests[i].expected);
+ g_free (filtered);
+ }
+}
+
GTestSuite *
test_filtering_create_test_suite (void)
{
@@ -91,6 +107,7 @@
#define TC(x) g_test_create_case(#x, 0, NULL, NULL, x, NULL)
g_test_suite_add(ts, TC(test_text_filter));
+ g_test_suite_add(ts, TC(test_newline_to_space));
return ts;
}