Skip to content

test(extract): bind the URL-builder language-gate test to a real URL shape - #1841

Merged
DeusData merged 1 commit into
mainfrom
fix/bind-url-builder-gate-test
Aug 27, 2026
Merged

DeusData merged 1 commit into
mainfrom
fix/bind-url-builder-gate-test

Conversation

@DeusData

Copy link
Copy Markdown
Owner

Follow-up to #1010, which merged as 909051c.

That PR added a language gate restricting URL-builder resolution to JS/TS/TSX, and a test meant to prove C is excluded. The test does not prove it. Its fixture returns /etc/myapp/conf.d, and is_filesystem_path() rejects /etc/ before is_rest_path() is ever consulted — so the value is never classified as a URL and never recorded as a builder, gate or no gate. Remove the gate entirely and the test still passes.

This changes the fixture to /srv/myapp/conf.d, which is not one of the ten filesystem prefixes and is therefore genuinely URL-shaped. Only the language gate now stops it being recorded for C.

Verified by revert-check, not by assertion:

  • gate present → extract_c_url_builder_gated_issue1009 PASS
  • gate removed → FAIL at tests/test_extraction.c:3455
  • gate restored → PASS

Two lines, fixture only. The gate implementation is unchanged and remains @CharlesQueiroz's work; he is credited as co-author.

My own fault for the original: /etc/ was the example I used in July, and I only corrected it to "pick a path outside those prefixes" a few hours before the PR was pushed.

…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 #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>
@DeusData
DeusData merged commit 3cda5b1 into main Aug 27, 2026
61 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant