Skip to content

Commit a4bb0cc

Browse files
committed
Python: Run tests for fieldflow/test.py
1 parent 1390f03 commit a4bb0cc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

python/ql/test/experimental/dataflow/fieldflow/test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import sys
2+
import os
3+
4+
sys.path.append(os.path.dirname(os.path.dirname((__file__))))
5+
from testlib import *
6+
17
# These are defined so that we can evaluate the test code.
28
NONSOURCE = "not a source"
39
SOURCE = "source"
@@ -37,12 +43,13 @@ def __init__(self):
3743
def getObj(self):
3844
return self.obj
3945

46+
# Actual tests
4047

4148
def setFoo(obj, x):
4249
SINK_F(obj.foo)
4350
obj.foo = x
4451

45-
52+
@expects(2)
4653
def test_example1():
4754
myobj = MyObj("OK")
4855

python/ql/test/experimental/dataflow/validTest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def check_tests_valid(testFile):
5757
check_tests_valid("variable-capture.nonlocal")
5858
check_tests_valid("variable-capture.dict")
5959
check_tests_valid("module-initialization.multiphase")
60+
check_tests_valid("fieldflow.test")
6061

6162
# The below will fail unless we use Python 3.10 or newer.
6263
# check_tests_valid("match.test")

0 commit comments

Comments
 (0)