summaryrefslogtreecommitdiff
path: root/tests/test_domain_cpp.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-07-26 22:31:16 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-07-26 22:31:16 +0100
commit6f530ca3ea305a4c4e077a237fc7196e959a4bb4 (patch)
treed87ce0e5f21225e1f55cbe3c20e9b0f1057b3d7d /tests/test_domain_cpp.py
parent19b54dce6a8535afdab2744cd09cef515a320982 (diff)
parent65f548e6ee968f6183f3dcbbdf999268a6c9b257 (diff)
downloadsphinx-git-6f530ca3ea305a4c4e077a237fc7196e959a4bb4.tar.gz
Merge branch '5.x'
Diffstat (limited to 'tests/test_domain_cpp.py')
-rw-r--r--tests/test_domain_cpp.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
index 3f31aaa18..ee8da3d39 100644
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -891,8 +891,33 @@ def test_domain_cpp_ast_requires_clauses():
{4: 'I0EIQaa1A1BE1fvv'})
check('function', 'template<typename T> requires A || B or C void f()',
{4: 'I0EIQoo1Aoo1B1CE1fvv'})
+ check('function', 'void f() requires A || B || C',
+ {4: 'IQoo1Aoo1B1CE1fv'})
+ check('function', 'Foo() requires A || B || C',
+ {4: 'IQoo1Aoo1B1CE3Foov'})
check('function', 'template<typename T> requires A && B || C and D void f()',
{4: 'I0EIQooaa1A1Baa1C1DE1fvv'})
+ check('function',
+ 'template<typename T> requires R<T> ' +
+ 'template<typename U> requires S<T> ' +
+ 'void A<T>::f() requires B',
+ {4: 'I0EIQ1RI1TEEI0EIQaa1SI1TE1BEN1AI1TE1fEvv'})
+ check('function',
+ 'template<template<typename T> requires R<T> typename X> ' +
+ 'void f()',
+ {2: 'II0EIQ1RI1TEE0E1fv', 4: 'II0EIQ1RI1TEE0E1fvv'})
+ check('type',
+ 'template<typename T> requires IsValid<T> {key}T = true_type',
+ {4: 'I0EIQ7IsValidI1TEE1T'}, key='using')
+ check('class',
+ 'template<typename T> requires IsValid<T> {key}T : Base',
+ {4: 'I0EIQ7IsValidI1TEE1T'}, key='class')
+ check('union',
+ 'template<typename T> requires IsValid<T> {key}T',
+ {4: 'I0EIQ7IsValidI1TEE1T'}, key='union')
+ check('member',
+ 'template<typename T> requires IsValid<T> int Val = 7',
+ {4: 'I0EIQ7IsValidI1TEE3Val'})
def test_domain_cpp_ast_template_args():