test(extract): bind the URL-builder language-gate test to a real URL shape - #1841
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andis_filesystem_path()rejects/etc/beforeis_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:
extract_c_url_builder_gated_issue1009PASStests/test_extraction.c:3455Two 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.