Skip to content

Commit

Permalink
added test for detector divz
Browse files Browse the repository at this point in the history
  • Loading branch information
chyanju committed Feb 28, 2024
1 parent 22521ec commit 27a0bc6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
run: python tests/scripts/dep.py

parser-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install dependencies
run: |
pip install networkx[default]
pip install lark
- name: test parsing.py
run: PYTHONPATH="./" python ./tests/scripts/parsing.py

detector-test-divz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 11 additions & 0 deletions tests/scripts/test-divz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from vanguard.aleo.grammar import AleoEnvironment
from vanguard.aleo.detectors.divz import detector_divz

if __name__ == "__main__":
project_name = "divz0"
build_path = f"./tests/public/{project_name}/build/"
env = AleoEnvironment(build_path)
main = env.main
fid = "ex0"
res, info = detector_divz(env, main.id, fid)
assert not res, f"Test failed for {fid}, expected: True, got: {res}"

0 comments on commit 27a0bc6

Please sign in to comment.