Add test case for recent types-regex regression (#9269)

This commit is contained in:
Alex Waygood authored and GitHub committed 2022-11-24 11:37:12 -08:00
1 parent 89f22278ba
commit b3728f38f5
1 file changed
+13
@@ -0,0 +1,13 @@
# pyright: reportUnnecessaryTypeIgnoreComment=true
from __future__ import annotations
from typing import List
from typing_extensions import assert_type
import regex
# Regression tests for #9263
assert_type(list(regex.finditer(r"foo", "foo")), List[regex.Match[str]])
pat = regex.compile(rb"foo")
assert_type(list(pat.finditer(b"foo")), List[regex.Match[bytes]])