From 4b7d46b384d145f096bb51e8ee8b7fdb3f8d33e5 Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 29 Apr 2024 19:06:04 +0200 Subject: [PATCH] test exercising transformer from string input As title --- numba_rvsdg/tests/test_ast_transforms.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/numba_rvsdg/tests/test_ast_transforms.py b/numba_rvsdg/tests/test_ast_transforms.py index a5cbf7f..d7fd493 100644 --- a/numba_rvsdg/tests/test_ast_transforms.py +++ b/numba_rvsdg/tests/test_ast_transforms.py @@ -1,4 +1,5 @@ # mypy: ignore-errors +import textwrap from typing import Callable, Any from unittest import main, TestCase @@ -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