Skip to content

Commit

Permalink
add test to make sure viper code is handled by ast parser
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Feb 11, 2023
1 parent 3ec4fbf commit a2bfa80
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/packagemanager/test_group.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

import belay.packagemanager
from belay.packagemanager import Group
from belay.packagemanager.group import Group, _verify_files


@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -71,3 +71,17 @@ def test_group_clean(main_group):

assert (main_group.folder / "foo").exists()
assert not (main_group.folder / "baz").exists()


def test_verify_files_micropython_viper(tmp_path):
code_path = tmp_path / "code.py"
code_path.write_text(
"""
@micropython.viper
def foo(self, arg: int) -> int:
buf = ptr8(self.linebuf) # self.linebuf is a bytearray or bytes object
for x in range(20, 30):
bar = buf[x] # Access a data item through the pointer
"""
)
_verify_files(code_path)

0 comments on commit a2bfa80

Please sign in to comment.