Skip to content

Commit c156221

Browse files
committed
Added some more tests
1 parent bbce6d1 commit c156221

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/test_domains/test_domain_cpp.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,19 @@ def test_domain_cpp_ast_function_definitions() -> None:
863863

864864
check('function', 'decltype(auto) f()', {1: 'f', 2: '1fv'})
865865

866-
# Test derived from https://github.com/sphinx-doc/sphinx/issues/14026
867-
# Unicode identifiers
866+
# Tests derived from
867+
# https://github.com/sphinx-doc/sphinx/issues/14026 Unicode
868+
# identifiers
868869
check('function', 'void f(int *const ξ)', {1: 'f__iPC', 2: '1fPCi'})
870+
check('function', 'template<typename Ξ> Ξ ξcompute(Ξ ξ)',
871+
{2: 'I0E8ξcompute1Ξ',
872+
3: 'I0E8ξcompute1Ξ',
873+
4: 'I0E8ξcompute1Ξ1Ξ'})
874+
check('function', 'ΨStruct ψcompute(double i)',
875+
{1: 'ψcompute__double',
876+
2: '8ψcomputed',
877+
3: '8ψcomputed',
878+
4: '8ψcomputed'})
869879

870880
# TODO: make tests for functions in a template, e.g., Test<int&&()>
871881
# such that the id generation for function type types is correct.
@@ -1056,6 +1066,13 @@ def test_domain_cpp_ast_class_definitions() -> None:
10561066
{2: 'I_DpiE1TIJX(Is)EEE', 3: 'I_DpiE1TIJX2IsEEE'},
10571067
)
10581068

1069+
# Test derived from
1070+
# https://github.com/sphinx-doc/sphinx/issues/14026 Unicode
1071+
# identifier
1072+
check('class', 'public ΨStruct', {1: 'ΨStruct', 2: '7ΨStruct',
1073+
3: '7ΨStruct', 4: '7ΨStruct'},
1074+
output='{key}ΨStruct')
1075+
10591076

10601077
def test_domain_cpp_ast_union_definitions() -> None:
10611078
check('union', '{key}A', {2: '1A'})

0 commit comments

Comments
 (0)