MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / test_patterns

Function test_patterns

tests/test_ast_pattern_matching.py:159–171  ·  view source on GitHub ↗
(src, pattern, should_match)

Source from the content-addressed store, hash-verified

157
158@pytest.mark.parametrize("src,pattern,should_match", CASES)
159def test_patterns(src, pattern, should_match):
160 signature = {
161 "pattern": pattern,
162 "taint": {
163 "level": "tainted"
164 }
165 }
166 compiled_src = ASTPattern._compile_src(src)
167 p = ASTPattern(signature=signature)
168
169 v = PatternMatchingVisitor(pattern=p)
170 result = v.traverse(compiled_src)
171 assert bool(result) is should_match
172
173
174def test_matching_triggers():

Callers

nothing calls this directly

Calls 4

traverseMethod · 0.95
ASTPatternClass · 0.90
_compile_srcMethod · 0.80

Tested by

no test coverage detected