Skip to content

Commit 16e391f

Browse files
committed
add run tests
1 parent feaabbe commit 16e391f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

mypyc/test-data/run-functions.test

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,3 +1312,29 @@ from native import f
13121312
print(f(1))
13131313
[out]
13141314
2
1315+
1316+
[case testStarArgFastPaths]
1317+
from typing import Any, Mapping
1318+
def fn(x: str, y: int) -> str:
1319+
return x * y
1320+
def star_tuple(*args: Any) -> None:
1321+
return fn(*args)
1322+
def star_list(args: list[Any]) -> None:
1323+
return fn(*args)
1324+
def star_generic(args: dict[Any, Any]) -> str:
1325+
return fn(*args)
1326+
def star2(**kwargs: Any) -> None:
1327+
return fn(**kwargs)
1328+
def star2_generic(kwargs: Mapping[Any, Any]) -> None:
1329+
return fn(**kwargs)
1330+
1331+
def test_star_fastpath_tuple() -> None:
1332+
assert star_tuple("a", 3) == "aaa"
1333+
def test_star_fastpath_list() -> None:
1334+
assert star_list(["a", 3]) == "aaa"
1335+
def test_star_fastpath_generic() -> None:
1336+
assert star_generic({"a": None, 3: None}) == "aaa"
1337+
def test_star2_fastpath() -> None
1338+
assert star2(x="a", y=3) == "aaa"
1339+
def test_star2_fastpath_generic() -> None
1340+
assert star2_generic({x: "a", y: 3}) == "aaa"

0 commit comments

Comments
 (0)