Skip to content

Commit

Permalink
Added tests for in
Browse files Browse the repository at this point in the history
  • Loading branch information
AryazE committed Sep 3, 2024
1 parent a543353 commit a132327
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/trace_single_hook/in/analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from dynapyt.analyses.BaseAnalysis import BaseAnalysis


class TestAnalysis(BaseAnalysis):
def _in(self, dyn_ast, iid, left, right, result):
print(f"Checking if {left} is in {right} --> {result}")
5 changes: 5 additions & 0 deletions tests/trace_single_hook/in/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Checking if 2 is in [1, 2, 3] --> True
2 is in l
1
2
3
5 changes: 5 additions & 0 deletions tests/trace_single_hook/in/program.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
l = [1, 2, 3]
if 2 in l:
print("2 is in l")
for i in l:
print(i)

0 comments on commit a132327

Please sign in to comment.