MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_invalid_float_values

Function check_invalid_float_values

ccan/ccan/graphql/test/run.c:2343–2366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2341}
2342
2343void check_invalid_float_values(char *source) {
2344 struct list_head *tokens;
2345
2346 if (!mute) printf("// Invalid Float Values\n");
2347
2348 const char *bad_values[] = {"00.0", "-00.0", "00e1", "1.23.4", "0x1.2p3", 0};
2349
2350 for (int i=0; bad_values[i]; i++) {
2351 sprintf(source, "\
2352{\n\
2353 user(id: %s) {\n\
2354 name\n\
2355 }\n\
2356}\n\
2357 ", bad_values[i]);
2358
2359 // Test the lexer.
2360 TEST_CONT(graphql_lex(NULL, source, &tokens) != NULL);
2361 TEST_ABRT(listlen(tokens) == 5);
2362 tokens = tal_free(tokens);
2363
2364 // No need to test parser when lexer fails.
2365 }
2366}
2367
2368void check_boolean_values(char *source) {
2369 struct list_head *tokens;

Callers

nothing calls this directly

Calls 3

graphql_lexFunction · 0.85
listlenFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected