| 2341 | } |
| 2342 | |
| 2343 | void 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 | |
| 2368 | void check_boolean_values(char *source) { |
| 2369 | struct list_head *tokens; |
nothing calls this directly
no test coverage detected