Python: Post-processing query for inline test expectations

This commit is contained in:
Tom Hvitved
2024-09-23 14:20:28 +02:00
parent 4750b0de94
commit e5f2bbb6ec
7 changed files with 46 additions and 21 deletions

View File

@@ -1 +1,2 @@
Numerics/Pythagorean.ql
query: Numerics/Pythagorean.ql
postprocess: TestUtilities/InlineExpectationsTestQuery.ql

View File

@@ -3,12 +3,12 @@
from math import sqrt
def withPow(a, b):
return sqrt(a**2 + b**2)
return sqrt(a**2 + b**2) # $ Alert
def withMul(a, b):
return sqrt(a*a + b*b)
return sqrt(a*a + b*b) # $ Alert
def withRef(a, b):
a2 = a**2
b2 = b*b
return sqrt(a2 + b2)
return sqrt(a2 + b2) # $ Alert