diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-09-29 08:32:09 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-09-29 08:40:25 +0200 |
commit | ebffe5503d1709f00d4d7d85f0db4f8fe1dc4f42 (patch) | |
tree | c35dca4f2e9abeb271eeca3560b2ef83d3ff2831 /test | |
parent | a1ea3e268f92e9edcce6a794d98929effb036675 (diff) |
Implement support for specifying negated match
- Prepending - inverts the matching result.
- Fix logic window/drun browser.
- Breaks API as argument token_match callback changed.
- Update tests.
Fixes: #665
Diffstat (limited to 'test')
-rw-r--r-- | test/helper-tokenize.c | 9 | ||||
-rw-r--r-- | test/mode-test.c | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/test/helper-tokenize.c b/test/helper-tokenize.c index c251f04e..b4635df8 100644 --- a/test/helper-tokenize.c +++ b/test/helper-tokenize.c @@ -37,6 +37,7 @@ #include "xcb-internal.h" #include "rofi.h" #include "settings.h" +#include "rofi-types.h" static int test = 0; @@ -75,7 +76,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) } { config.matching_method = MM_NORMAL; - GRegex **tokens = tokenize ( "noot", FALSE ); + rofi_int_matcher **tokens = tokenize ( "noot", FALSE ); TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE ); TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE ); @@ -108,7 +109,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) } { config.matching_method = MM_GLOB; - GRegex **tokens = tokenize ( "noot", FALSE ); + rofi_int_matcher **tokens = tokenize ( "noot", FALSE ); TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE ); TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE ); @@ -165,7 +166,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) } { config.matching_method = MM_FUZZY; - GRegex **tokens = tokenize ( "noot", FALSE ); + rofi_int_matcher **tokens = tokenize ( "noot", FALSE ); TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE ); TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE ); @@ -221,7 +222,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) } { config.matching_method = MM_REGEX; - GRegex **tokens = tokenize ( "noot", FALSE ); + rofi_int_matcher **tokens = tokenize ( "noot", FALSE ); TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE ); TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE ); diff --git a/test/mode-test.c b/test/mode-test.c index 00720d95..1c1a271a 100644 --- a/test/mode-test.c +++ b/test/mode-test.c @@ -146,13 +146,13 @@ END_TEST START_TEST(test_mode_match_entry) { - GRegex **t = tokenize( "primary-paste", FALSE ); + rofi_int_matcher **t = tokenize( "primary-paste", FALSE ); ck_assert_ptr_nonnull ( t ); ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE ); ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 1), FALSE ); tokenize_free ( t ); - t = tokenize( "-paste", FALSE ); + t = tokenize( "y-paste", FALSE ); ck_assert_ptr_nonnull ( t ); ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE ); |