diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-06-26 23:00:41 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-06-26 23:00:41 +0200 |
commit | b9c624d2eef609b2cd3456828b3f0858477b1fbf (patch) | |
tree | 3bcf37d0562a7822e7735cd5dcb8178cf67d386a | |
parent | 5eb9fad4e36a942583c1c3777dfa923221e0892f (diff) |
Add test for strings with embedded "'s
-rw-r--r-- | test/theme-parser-test.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c index 77148ab6..b14b358a 100644 --- a/test/theme-parser-test.c +++ b/test/theme-parser-test.c @@ -1024,6 +1024,21 @@ START_TEST ( test_properties_padding_4 ) } END_TEST +START_TEST ( test_properties_string_escape ) +{ + widget wid; + wid.name = "blaat"; + wid.state = NULL; + rofi_theme_parse_string ( "* { font: \"aap\" noot\" mies \";\ntest: \"'123.432'\"; }"); + + const char *str= rofi_theme_get_string ( &wid, "font", NULL ); + ck_assert_ptr_nonnull ( str ); + ck_assert_int_eq ( g_utf8_collate ( str, "aap\" noot\" mies " ) , 0 ); + const char *str2= rofi_theme_get_string ( &wid, "test", NULL ); + ck_assert_ptr_nonnull ( str2 ); + ck_assert_int_eq ( g_utf8_collate ( str2, "'123.432'" ) , 0 ); +} +END_TEST START_TEST ( test_properties_string ) { widget wid; @@ -1308,6 +1323,7 @@ static Suite * theme_parser_suite (void) TCase *tc_prop_string = tcase_create("PropertiesString"); tcase_add_checked_fixture(tc_prop_string, theme_parser_setup, theme_parser_teardown); tcase_add_test ( tc_prop_string, test_properties_string); + tcase_add_test ( tc_prop_string, test_properties_string_escape); suite_add_tcase(s, tc_prop_string ); } |