summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-02 22:12:00 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-02 22:12:00 +0200
commit218886f89799e6bd20d2034ccca4a881926c4315 (patch)
tree62a26ca39fd048f181dca9fceef15cffe6e48901 /test
parentc5f54777888080c0d74ab7f2d0423ea167b84e24 (diff)
Make matching keywords like Vertical case-insensitive add test.
- Make keywords like dash, horizontal, etc case-insensitive. - Add test for orientation property.
Diffstat (limited to 'test')
-rw-r--r--test/theme-parser-test.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c
index d135cb40..6c78af68 100644
--- a/test/theme-parser-test.c
+++ b/test/theme-parser-test.c
@@ -1051,6 +1051,34 @@ START_TEST ( test_properties_integer)
ck_assert_int_eq ( rofi_theme_get_integer ( &wid, "yoffset", 0) , 4);
}
END_TEST
+
+
+START_TEST ( test_properties_orientation )
+{
+ widget wid;
+ wid.name = "blaat";
+ wid.state = NULL;
+ rofi_theme_parse_string ( "* { vert: vertical; hori: horizontal; }");
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "vert", ROFI_ORIENTATION_HORIZONTAL) , ROFI_ORIENTATION_VERTICAL);
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "hori", ROFI_ORIENTATION_VERTICAL) , ROFI_ORIENTATION_HORIZONTAL);
+ // default propagation
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "notfo", ROFI_ORIENTATION_HORIZONTAL) , ROFI_ORIENTATION_HORIZONTAL);
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "notfo", ROFI_ORIENTATION_VERTICAL) , ROFI_ORIENTATION_VERTICAL);
+
+}
+END_TEST
+START_TEST ( test_properties_orientation_case )
+{
+ widget wid;
+ wid.name = "blaat";
+ wid.state = NULL;
+ rofi_theme_parse_string ( "* { vert: Vertical; hori: HoriZonTal;}");
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "vert", ROFI_ORIENTATION_HORIZONTAL) , ROFI_ORIENTATION_VERTICAL);
+ ck_assert_int_eq ( rofi_theme_get_orientation( &wid, "hori", ROFI_ORIENTATION_VERTICAL) , ROFI_ORIENTATION_HORIZONTAL);
+
+}
+END_TEST
+
START_TEST ( test_configuration )
{
rofi_theme_parse_string ( "configuration { font: \"blaat€\"; yoffset: 4; }");
@@ -1241,6 +1269,13 @@ static Suite * theme_parser_suite (void)
suite_add_tcase(s, tc_prop_integer );
}
{
+ TCase *tc_prop_orientation = tcase_create("Propertiesorientation");
+ tcase_add_checked_fixture(tc_prop_orientation, theme_parser_setup, theme_parser_teardown);
+ tcase_add_test ( tc_prop_orientation, test_properties_orientation);
+ tcase_add_test ( tc_prop_orientation, test_properties_orientation_case );
+ suite_add_tcase(s, tc_prop_orientation );
+ }
+ {
TCase *tc_prop_configuration = tcase_create("Configuration");
tcase_add_checked_fixture(tc_prop_configuration, theme_parser_setup, theme_parser_teardown);
tcase_add_test ( tc_prop_configuration, test_configuration);