test_guard_substrate.py¶
tests/guard/test_guard_substrate.py
The gate's extension -> language table comes from lang-parsing-substrate.
test_languages_without_a_spec_are_not_mapped
test_guard_substrate.test_languages_without_a_spec_are_not_mapped()
Go is in the substrate but the gate has no LanguageSpec for it.
tests/guard/test_guard_substrate.py:24
Checks
assert ".go" not in EXTENSION_TO_LANGUAGEassert language_for_file("main.go", {}) is None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-020 | measured | test_languages_without_a_spec_are_not_mapped → language_for_file |
Source · 6 lines
def test_languages_without_a_spec_are_not_mapped():
"""Go is in the substrate but the gate has no LanguageSpec for it."""
assert ".go" not in EXTENSION_TO_LANGUAGE
assert language_for_file("main.go", {}) is None
Activity · 2 steps
test_tsx_is_routed_to_the_jsx_aware_grammar
test_guard_substrate.test_tsx_is_routed_to_the_jsx_aware_grammar()
The substrate files `.tsx` under typescript; the gate parses it with the tsx grammar.
tests/guard/test_guard_substrate.py:30
Checks
assert EXTENSION_TO_LANGUAGE[".tsx"] == "typescript"assert language_for_file("App.tsx", {}) == "tsx"assert language_for_file("app.ts", {}) == "typescript"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-020 | measured | test_tsx_is_routed_to_the_jsx_aware_grammar → language_for_file |
Source · 7 lines
def test_tsx_is_routed_to_the_jsx_aware_grammar():
"""The substrate files `.tsx` under typescript; the gate parses it with the tsx grammar."""
assert EXTENSION_TO_LANGUAGE[".tsx"] == "typescript"
assert language_for_file("App.tsx", {}) == "tsx"
assert language_for_file("app.ts", {}) == "typescript"