1 #include <gplate/gplate.h>
4 gplate_util_test_quoted_string_helper(const gchar *string,
5 const gchar *contents, gboolean value)
10 r = gplate_util_is_quoted_string(string, &c);
11 g_assert_cmpint(r, ==, value);
14 g_assert_cmpstr(c, ==, contents);
20 gplate_util_test_quoted_string(void) {
21 gplate_util_test_quoted_string_helper("\"abc\"", "abc", TRUE);
22 gplate_util_test_quoted_string_helper("\"abc def\"", "abc def", TRUE);
23 gplate_util_test_quoted_string_helper("\"abc\tdef\bghi\"", "abc\tdef\bghi", TRUE);
24 gplate_util_test_quoted_string_helper("abc \"def\"", NULL, FALSE);
25 gplate_util_test_quoted_string_helper("\"abc\" def", NULL, FALSE);
26 gplate_util_test_quoted_string_helper("'abc'", "abc", TRUE);
27 gplate_util_test_quoted_string_helper("'abc def'", "abc def", TRUE);
28 gplate_util_test_quoted_string_helper("'abc\tdef\bghi'", "abc\tdef\bghi", TRUE);
29 gplate_util_test_quoted_string_helper("abc 'def'", NULL, FALSE);
30 gplate_util_test_quoted_string_helper("'abc' def", NULL, FALSE);
31 gplate_util_test_quoted_string_helper("'abc\"", NULL, FALSE);
32 gplate_util_test_quoted_string_helper("\"abc'", NULL, FALSE);
36 main(gint argc, gchar **argv) {
37 g_test_init(&argc, &argv, NULL);
39 g_test_add_func("/util/quoted_string", gplate_util_test_quoted_string);