util: add streq() function and use in place of strcmp(...) == 0

This commit is contained in:
Craig Barnes 2024-01-24 23:17:28 +00:00 committed by Daniel Eklöf
parent 44c0cf594b
commit e0f3703ae6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
16 changed files with 172 additions and 165 deletions

View file

@ -854,7 +854,7 @@ UNITTEST
const struct key_data *info = keymap_lookup(&term, XKB_KEY_ISO_Left_Tab, MOD_SHIFT | MOD_CTRL);
xassert(info != NULL);
xassert(strcmp(info->seq, "\033[27;6;9~") == 0);
xassert(streq(info->seq, "\033[27;6;9~"));
}
UNITTEST
@ -865,12 +865,12 @@ UNITTEST
const struct key_data *info = keymap_lookup(&term, XKB_KEY_Return, MOD_ALT);
xassert(info != NULL);
xassert(strcmp(info->seq, "\033\r") == 0);
xassert(streq(info->seq, "\033\r"));
term.modify_other_keys_2 = true;
info = keymap_lookup(&term, XKB_KEY_Return, MOD_ALT);
xassert(info != NULL);
xassert(strcmp(info->seq, "\033[27;3;13~") == 0);
xassert(streq(info->seq, "\033[27;3;13~"));
}
void