Skip to content

Commit b9bd036

Browse files
committed
test(cross-repo): seed method-less client edges so the verb fallback binds (DeusData#2768)
All three seeded client edges carried "GET", so match_http_routes never entered its callee-verb fallback. getItem and getJob are now stored without a method, as an index that did not record the verb writes them. Without the fallback the method-less fuzzy match lands on the DELETE and POST routes seeded first; with it both reach their GET handlers. getItems keeps its explicit GET. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent e12d3db commit b9bd036

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎tests/test_cross_repo.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,11 @@ static int cross_repo_count_edges_like(const cross_repo_fixture_t *fixture, cons
10691069
* POST /items/{parentId}/{id} (seeded first in DB)
10701070
* GET /items/job/{jobId} (seeded second in DB)
10711071
* the fuzzy route matcher must enforce method compatibility, linking the GET calls
1072-
* to their respective GET endpoints and never to DELETE or POST endpoints. */
1072+
* to their respective GET endpoints and never to DELETE or POST endpoints.
1073+
* getItem and getJob are seeded WITHOUT a method property (an edge written by an
1074+
* index that did not record the verb): the matcher must infer GET from the
1075+
* callee's verb suffix, or the method-less fuzzy match lands on the DELETE / POST
1076+
* route seeded first. getItems keeps its explicit "GET". */
10731077
TEST(cross_repo_angular_http_client_exact_verb_matching_issue2768) {
10741078
cross_repo_fixture_t fixture;
10751079
bool setup = cross_repo_fixture_begin(&fixture) &&
@@ -1088,9 +1092,9 @@ TEST(cross_repo_angular_http_client_exact_verb_matching_issue2768) {
10881092
cross_repo_seed_client_call(&fixture, "angular-2768", "getItems",
10891093
"this.http.get", "/items/list", "GET") &&
10901094
cross_repo_seed_client_call(&fixture, "angular-2768", "getItem",
1091-
"this.http.get", "/items/42", "GET") &&
1095+
"this.http.get", "/items/42", NULL) &&
10921096
cross_repo_seed_client_call(&fixture, "angular-2768", "getJob",
1093-
"this.http.get", "/items/job/10", "GET");
1097+
"this.http.get", "/items/job/10", NULL);
10941098
if (!setup) {
10951099
cross_repo_fixture_end(&fixture);
10961100
FAIL("failed to seed issue 2768 fixture");

0 commit comments

Comments
 (0)