(src, pattern, should_match)
| 157 | |
| 158 | @pytest.mark.parametrize("src,pattern,should_match", CASES) |
| 159 | def 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 | |
| 174 | def test_matching_triggers(): |
nothing calls this directly
no test coverage detected