summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTonCherAmi <kratos661@gmail.com>2021-05-23 01:17:27 +0300
committerGitHub <noreply@github.com>2021-05-23 00:17:27 +0200
commitdc28a974373b5d462a734e35b8b47afce0782c77 (patch)
tree432760a640e58924da590016b4c99881a32d993d /test
parent04c006a4a23dd71a3c4af8df63329ab436411740 (diff)
Add cursor property (#1313)
* Change mouse cursor on widget hover Currently only listview element and editbox are supported. * Add cursor property
Diffstat (limited to 'test')
-rw-r--r--test/theme-parser-test.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c
index dd722468..ab0800bd 100644
--- a/test/theme-parser-test.c
+++ b/test/theme-parser-test.c
@@ -1106,6 +1106,28 @@ START_TEST ( test_properties_orientation_case )
}
END_TEST
+START_TEST ( test_properties_cursor )
+{
+ widget wid;
+ wid.name = "blaat";
+ wid.state = NULL;
+ rofi_theme_parse_string ( "* { def: default; ptr: pointer; txt: text; }");
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "def", ROFI_CURSOR_TEXT), ROFI_CURSOR_DEFAULT);
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "ptr", ROFI_CURSOR_DEFAULT), ROFI_CURSOR_POINTER);
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "txt", ROFI_CURSOR_DEFAULT), ROFI_CURSOR_TEXT);
+}
+END_TEST
+START_TEST ( test_properties_cursor_case )
+{
+ widget wid;
+ wid.name = "blaat";
+ wid.state = NULL;
+ rofi_theme_parse_string ( "* { def: dEfault; ptr: POINter; txt: tExt; }");
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "def", ROFI_CURSOR_TEXT), ROFI_CURSOR_DEFAULT);
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "ptr", ROFI_CURSOR_DEFAULT), ROFI_CURSOR_POINTER);
+ ck_assert_int_eq ( rofi_theme_get_cursor_type( &wid, "txt", ROFI_CURSOR_DEFAULT), ROFI_CURSOR_TEXT);
+}
+END_TEST
START_TEST ( test_properties_list )
{
widget wid;
@@ -1376,6 +1398,13 @@ static Suite * theme_parser_suite (void)
suite_add_tcase(s, tc_prop_orientation );
}
{
+ TCase *tc_prop_cursor = tcase_create("Propertiescursor");
+ tcase_add_checked_fixture(tc_prop_cursor, theme_parser_setup, theme_parser_teardown);
+ tcase_add_test ( tc_prop_cursor, test_properties_cursor);
+ tcase_add_test ( tc_prop_cursor, test_properties_cursor_case );
+ suite_add_tcase(s, tc_prop_cursor );
+ }
+ {
TCase *tc_prop_list = tcase_create("Propertieslist");
tcase_add_checked_fixture(tc_prop_list, theme_parser_setup, theme_parser_teardown);
tcase_add_test ( tc_prop_list, test_properties_list);