2023-04-18 16:11:43 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2022-06-20 22:59:56 +00:00
|
|
|
import pytest
|
|
|
|
|
2023-04-18 16:11:43 +00:00
|
|
|
import env
|
2022-06-20 22:59:56 +00:00
|
|
|
from pybind11_tests import const_name as m
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("func", (m.const_name_tests, m.underscore_tests))
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"selector, expected",
|
|
|
|
enumerate(
|
|
|
|
(
|
|
|
|
"",
|
|
|
|
"A",
|
|
|
|
"Bd",
|
|
|
|
"Cef",
|
|
|
|
"%",
|
|
|
|
"%",
|
|
|
|
"T1",
|
|
|
|
"U2",
|
|
|
|
"D1",
|
|
|
|
"E2",
|
|
|
|
"KeepAtEnd",
|
|
|
|
)
|
|
|
|
),
|
|
|
|
)
|
|
|
|
def test_const_name(func, selector, expected):
|
2023-04-18 16:11:43 +00:00
|
|
|
if isinstance(func, type(u"") if env.PY2 else str):
|
2022-06-20 22:59:56 +00:00
|
|
|
pytest.skip(func)
|
|
|
|
text = func(selector)
|
|
|
|
assert text == expected
|