1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

tokenize: add one more api test

This commit is contained in:
Andy Green 2019-05-17 13:59:20 +01:00
parent 752e19391d
commit a404983096

View file

@ -158,6 +158,12 @@ struct expected expected1[] = {
{ LWS_TOKZE_DELIMITER, ".", 1 },
{ LWS_TOKZE_TOKEN, "com", 3 },
{ LWS_TOKZE_ENDED, "", 0 },
},
expected15[] = {
{ LWS_TOKZE_TOKEN, "close", 5 },
{ LWS_TOKZE_DELIMITER, ",", 1 },
{ LWS_TOKZE_TOKEN, "Upgrade", 7 },
{ LWS_TOKZE_ENDED, "", 0 },
}
;
@ -227,6 +233,11 @@ struct tests tests[] = {
expected14, LWS_ARRAY_SIZE(expected14),
LWS_TOKENIZE_F_NO_FLOATS
},
{
"close, Upgrade",
expected15, LWS_ARRAY_SIZE(expected15),
LWS_TOKENIZE_F_COMMA_SEP_LIST
},
};
/*
@ -308,7 +319,8 @@ int main(int argc, const char **argv)
if (e > 0 &&
(ts.token_len != exp->len ||
memcmp(exp->value, ts.token, exp->len))) {
lwsl_notice("fail token mismatch\n");
lwsl_notice("fail token mismatch %d %d %.*s\n",
ts.token_len, exp->len, ts.token_len, ts.token);
fail++;
break;
}