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

Function check_example_18

ccan/ccan/graphql/test/run.c:1442–1497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1440}
1441
1442void check_example_18(char *source) {
1443 struct list_head *tokens;
1444
1445 if (!mute) printf("// Example No. 18\n");
1446
1447 sprintf(source, "\
1448query noFragments {\n\
1449 user(id: 4) {\n\
1450 friends(first: 10) {\n\
1451 id\n\
1452 name\n\
1453 profilePic(size: 50)\n\
1454 }\n\
1455 mutualFriends(first: 10) {\n\
1456 id\n\
1457 name\n\
1458 profilePic(size: 50)\n\
1459 }\n\
1460 }\n\
1461}\n\
1462 ");
1463
1464 // Test the lexer.
1465 TEST_CONT(graphql_lex(NULL, source, &tokens) == NULL);
1466 TEST_ABRT(listlen(tokens) == 44);
1467 tokens = tal_free(tokens);
1468
1469 // Test the parser.
1470 struct graphql_executable_document *doc;
1471 TEST_CONT(graphql_lex(NULL, source, &tokens) == NULL);
1472 TEST_ABRT(graphql_parse(tokens, &doc) == NULL);
1473 TEST_ABRT(doc != NULL);
1474 TEST_ABRT(doc->first_def != NULL);
1475 TEST_ABRT(doc->first_def->op_def != NULL);
1476 TEST_ABRT(doc->first_def->op_def->sel_set != NULL);
1477 TEST_ABRT(doc->first_def->op_def->sel_set->first != NULL);
1478 TEST_CONT(doc->first_def->op_def->sel_set->first->next == NULL);
1479 TEST_ABRT(doc->first_def->op_def->sel_set->first->field != NULL);
1480 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set != NULL);
1481 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first != NULL);
1482 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field != NULL);
1483 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field->sel_set != NULL);
1484 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field->sel_set->first != NULL);
1485 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field->sel_set->first->next != NULL);
1486 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field->sel_set->first->next->next != NULL);
1487 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->field->sel_set->first->next->next->next == NULL);
1488 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next != NULL);
1489 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field != NULL);
1490 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field->sel_set != NULL);
1491 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field->sel_set->first != NULL);
1492 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field->sel_set->first->next != NULL);
1493 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field->sel_set->first->next->next != NULL);
1494 TEST_ABRT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->field->sel_set->first->next->next->next == NULL);
1495 TEST_CONT(doc->first_def->op_def->sel_set->first->field->sel_set->first->next->next == NULL);
1496 tokens = tal_free(tokens);
1497}
1498
1499void check_example_19(char *source) {

Callers

nothing calls this directly

Calls 4

graphql_lexFunction · 0.85
listlenFunction · 0.85
tal_freeFunction · 0.85
graphql_parseFunction · 0.85

Tested by

no test coverage detected