Skip to content

Commit 8f94ae6

Browse files
test(extract): bind the URL-builder language-gate test to a real URL shape
The fixture returned "/etc/myapp/conf.d", which is_filesystem_path() rejects before is_rest_path() is consulted, so the value was never classified as a URL and never recorded as a builder -- with or without the language gate. The test passed identically with the gate removed, so it certified nothing. "/srv/" is not one of the ten filesystem prefixes, so the value is URL-shaped and only the JS/TS/TSX gate prevents it being recorded for C. Verified by revert-check: with the gate removed the test now FAILS at tests/test_extraction.c:3455; with the gate restored it passes. Follow-up to DeusData#1010. The gate implementation is unchanged and is the author's. Co-authored-by: Charles Queiroz <fcqueiroz@liquibase.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 909051c commit 8f94ae6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tests/test_extraction.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,15 +3444,15 @@ static bool any_call_arg_resolves_to(CBMFileResult *r, const char *url) {
34443444

34453445
TEST(extract_c_url_builder_gated_issue1009) {
34463446
CBMFileResult *r = extract("static const char *cfg_path(void) {\n"
3447-
" return \"/etc/myapp/conf.d\";\n"
3447+
" return \"/srv/myapp/conf.d\";\n"
34483448
"}\n"
34493449
"void init(void) {\n"
34503450
" parse_config(cfg_path());\n"
34513451
"}\n",
34523452
CBM_LANG_C, "t", "conf.c");
34533453
ASSERT_NOT_NULL(r);
34543454
ASSERT_FALSE(r->has_error);
3455-
ASSERT_FALSE(any_call_arg_resolves_to(r, "/etc/myapp/conf.d"));
3455+
ASSERT_FALSE(any_call_arg_resolves_to(r, "/srv/myapp/conf.d"));
34563456
cbm_free_result(r);
34573457
PASS();
34583458
}

0 commit comments

Comments
 (0)