Skip to content

Commit

Permalink
test exercising transformer from string input
Browse files Browse the repository at this point in the history
As title
  • Loading branch information
esc committed Apr 29, 2024
1 parent d3137c5 commit 4b7d46b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions numba_rvsdg/tests/test_ast_transforms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# mypy: ignore-errors
import textwrap
from typing import Callable, Any
from unittest import main, TestCase

Expand Down Expand Up @@ -36,6 +37,21 @@ def function() -> int:
}
self.compare(function, expected)

def test_solo_return_from_string(self):
function = textwrap.dedent("""
def function() -> int:
return 1
""")

expected = {
"0": {
"instructions": ["return 1"],
"jump_targets": [],
"name": "0",
}
}
self.compare(function, expected)

def test_solo_assign(self):
def function() -> None:
x = 1 # noqa: F841
Expand Down

0 comments on commit 4b7d46b

Please sign in to comment.