HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/__pycache__/test_clinic.cpython-311.opt-2.pyc
�

��VcfY��p�ddlmZmZddlmZddlmZddlZddlZddl	Z
ddlZddlZejd��ej
d��5ddlZddlmZddd��n#1swxYwYGd�d��ZGd	�d
��ZGd�d��Zejd
d���ZGd�d��ZGd�de��ZGd�de��ZGd�de��ZGd�d��ZGd�d��ZGd�de��ZGd�de��ZGd �d!e��Zed"krej��dSdS)#�)�support�
test_tools)�	os_helper)�TestCaseN�clinic)�	DSLParserc��eZdZd�ZdS)�
FakeConverterc�"�||_||_dS�N)�name�args��selfr
rs   �$D:\Python311\Lib\test\test_clinic.py�__init__zFakeConverter.__init__s����	���	�	�	�N)�__name__�
__module__�__qualname__r�rrr
r
s#����������rr
c��eZdZd�Zd�ZdS)�FakeConverterFactoryc��||_dSr�r
�rr
s  rrzFakeConverterFactory.__init__s
����	�	�	rc�,�t|j|��Sr)r
r
)rr
�default�kwargss    r�__call__zFakeConverterFactory.__call__s���T�Y��/�/�/rN)rrrrr rrrrrs2���������0�0�0�0�0rrc��eZdZd�Zd�ZdS)�FakeConvertersDictc��i|_dSr)�used_converters�rs rrzFakeConvertersDict.__init__#s��!����rc�R�|j�|t|����Sr)r$�
setdefaultr)rr
rs   r�getzFakeConvertersDict.get&s$���#�.�.�t�5I�$�5O�5O�P�P�PrN)rrrrr(rrrr"r""s7������"�"�"�Q�Q�Q�Q�Qrr"�C�file)�language�filenamec�D�eZdZd�Zd�Zd�Zd�Zd�Zej	j
Z
dS)�
FakeClinicc��t��|_t��|_tjd��|_d|_i|_tjd|j��|_	tj��|_tj��|_
|t_d|_dx|_|_i|_|�dd��|�dd��|�dd��|jj}tjd|d��fd|d��fd	|d��fd
|d��fd|d��fd|d��fd
|d��ff��|_dS)N�r.�block�bufferr*�suppress�docstring_prototype�docstring_definition�methoddef_define�impl_prototype�parser_prototype�parser_definition�impl_definition)r"�
converters�legacy_convertersr�	CLanguager+r,�destination_buffers�BlockParser�block_parser�collections�OrderedDict�modules�classesr
�line_prefix�line_suffix�destinations�add_destinationr(�field_destinations)r�ds  rrzFakeClinic.__init__,sx��,�.�.���!3�!5�!5����(��.�.��
���
�#%�� �"�.�r�4�=�A�A���"�.�0�0���"�.�0�0�����
� ��	�.0�0���4�+�������W�h�/�/�/����V�X�.�.�.����Z��4�4�4���!��"-�"9�
"�A�A�j�M�M�2�
#�Q�Q�w�Z�Z�0�
���7���,�
�q�q��z�z�*�
���:���/�
 �!�!�G�*�*�-�
���'�
�
�+�;
�#�#����rc��|j�|��}|s$tjdt	|��z��|S)NzDestination does not exist: )rGr(�sys�exit�repr)rr
rJs   r�get_destinationzFakeClinic.get_destinationGsB����!�!�$�'�'���	B��H�3�d�4�j�j�@�A�A�A��rc��||jvr$tjdt|��z��t	j|||g|�R�|j|<dS)NzDestination already exists: )rGrLrMrNr�Destination)rr
�typers    rrHzFakeClinic.add_destinationMsY���4�$�$�	B��H�3�d�4�j�j�@�A�A�A�"(�"4�T�4��"M��"M�"M�"M���$���rc��|dkS)N�modulerrs  r�is_directivezFakeClinic.is_directiveRs
���x��rc��||j|<dSr)�called_directivesrs   r�	directivezFakeClinic.directiveUs��'+���t�$�$�$rN)rrrrrOrHrUrXr�Clinic�_module_and_classrrrr.r.+sk���������6���N�N�N�
 � � �,�,�,��
�7���rr.c��eZdZd�ZdS)�ClinicWholeFileTestc�4�tjtjd��d���}d}|�|�����}|d���}|�|d��|�|d��dS)Nr*�r,z/*[clinic]
foo
[clinic]*/�z[clinic]*/[clinic]*/z
[clinic]*/)rrYr=�parse�
splitlines�rstrip�assertNotEqual�assertEqual)r�c�raw�cooked�end_lines     r�test_eolzClinicWholeFileTest.test_eol[s���
�M�&�*�4�0�0�6�B�B�B��+��������(�(�*�*���!�9�#�#�%�%��	
���H�&<�=�=�=�����<�0�0�0�0�0rN)rrrrirrrr\r\Zs#������1�1�1�1�1rr\c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�ClinicGroupPermuterTestc�^�tj|||��}|�||��dSr)r�permute_optional_groupsrd)r�l�m�r�output�computeds      r�_testzClinicGroupPermuterTest._testps2���1�!�Q��:�:�������*�*�*�*�*rc�@�|�dggdgdggd��dS)N�start�stop�step))rv)rurv)rurvrw�rsr%s r�
test_rangez"ClinicGroupPermuterTest.test_rangets7���
�
�W�I�;���F�8�*��	
�	
�	
�	
�	
rc�B�|�ddggdgdggd��dS)N�x�y�ch�attr))r})r}r~)r{r|r})r{r|r}r~rxr%s r�test_add_windowz'ClinicGroupPermuterTest.test_add_window|s9���
�
�S�#�J�<�$��6�(���	
�	
�	
�	
�	
rc�P�|�gd�ddggdgddggd�gd��dS)	N)�a1�a2�a3�b1�b2�c1�d1�d2)�e1�e2�e3))r�)r�r�r�)r�r�r�r�r�)r�r�r�r�r�r�)r�r�r�r�r�r�r�r�)r�r�r�r�r�r�r�r�r�r�r�rxr%s r�test_ludicrousz&ClinicGroupPermuterTest.test_ludicrous�sO���
�
�&�&�&��t��5��v��t��N`�N`�N`�?a��	
�	
�	
�	
�	
rc�B�|�ggdgdgdggd��dS)N�a�bre)r)r�)r�r�)r�r�rerxr%s r�test_right_onlyz'ClinicGroupPermuterTest.test_right_only�s:���
�
�2�r�S�E�3�%���.��	
�	
�	
�	
�	
rc�B�d�}|�t|��dS)Nc�4�tjdggg��dS)Nr�)rrmrrr�fnzPClinicGroupPermuterTest.test_have_left_options_but_required_is_empty.<locals>.fn�s���*�C�5�"�b�9�9�9�9�9r)�assertRaises�AssertionError)rr�s  r�,test_have_left_options_but_required_is_emptyzDClinicGroupPermuterTest.test_have_left_options_but_required_is_empty�s-��	:�	:�	:����.�"�-�-�-�-�-rN)	rrrrsryrr�r�r�rrrrkrkosn������+�+�+�
�
�
�
�
�
�	
�	
�	
�
�
�
�.�.�.�.�.rrkc�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�ClinicLinearFormatTestc�V�tj|fi|��}|�||��dSr)r�
linear_formatrd)r�inputrqrrrs     rrszClinicLinearFormatTest._test�s6���'��8�8��8�8�������*�*�*�*�*rc�2�|�dd��dS)Nr0rxr%s r�test_empty_stringsz)ClinicLinearFormatTest.test_empty_strings�s���
�
�2�r�����rc�2�|�dd��dS)N�
rxr%s r�test_solo_newlinez(ClinicLinearFormatTest.test_solo_newline�s���
�
�4������rc�2�|�dd��dS)Nz
          abc
          rxr%s r�test_no_substitutionz+ClinicLinearFormatTest.test_no_substitution�s,���
�
���	�	�	�	�	rc�6�|�ddd���dS)N�8
          abc
          {name}
          def
          z'
          abc
          def
          r0rrxr%s r�test_empty_substitutionz.ClinicLinearFormatTest.test_empty_substitution�s6���
�
����	�	�	�	�	�	rc�6�|�ddd���dS)Nr�z8
          abc
          GARGLE
          def
          �GARGLErrxr%s r�test_single_line_substitutionz4ClinicLinearFormatTest.test_single_line_substitution�s6���
�
����	�	�	�	�	�	rc�6�|�ddd���dS)Nr�zJ
          abc
          bingle
          bungle

          def
          zbingle
bungle
rrxr%s r�test_multiline_substitutionz2ClinicLinearFormatTest.test_multiline_substitution�s6���
�
���'�	�
	(�
	(�
	(�
	(�
	(rN)
rrrrsr�r�r�r�r�r�rrrr�r��s}������+�+�+�������������	�	�	�(�(�(�(�(rr�c��eZdZd�Zd�ZdS)�InertParserc��dSrr�rrs  rrzInertParser.__init__�����rc��dSrr�rr1s  rr`zInertParser.parse�r�rN�rrrrr`rrrr�r��s2������
�
�
�
�
�
�
�
rr�c��eZdZd�Zd�ZdS)�
CopyParserc��dSrrr�s  rrzCopyParser.__init__�r�rc��|j|_dSr)r�rqr�s  rr`zCopyParser.parse�s���{����rNr�rrrr�r��s2������
�
�
�#�#�#�#�#rr�c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�ClinicBlockParserTestc��tjd��}ttj||����}tj|��}|D]}|�|���|j���}dSr)rr=�listr?�BlockPrinter�print_block�f�getvalue)rr�rqr+�blocks�writerr1s       rrszClinicBlockParserTest._test�sy���#�D�)�)���f�(���9�9�:�:���$�X�.�.���	&�	&�E����u�%�%�%�%���"�"�$�$���rc�.�|�||��Srrx)rr�s  r�
round_tripz ClinicBlockParserTest.round_trip�s���z�z�%��'�'�'rc�0�|�d��dS)Nz(
    verbatim text here
    lah dee dah
�r�r%s r�test_round_trip_1z'ClinicBlockParserTest.test_round_trip_1�s'������	�	�	�	�	rc�0�|�d��dS)Nz�
    verbatim text here
    lah dee dah
/*[inert]
abc
[inert]*/
def
/*[inert checksum: 7b18d017f89f61cf17d47f92749ea6930a3f1deb]*/
xyz
r�r%s r�test_round_trip_2z'ClinicBlockParserTest.test_round_trip_2�s'�����	�		�		�		�		�		rc��tjd��}tj|d���}t|��|jd<t|��|jd<|�|��}|�||��dS)Nr*r^�inert�copy)rr=rYr��parsersr�r`rd)rr�rqr+rerrs      r�_test_clinicz"ClinicBlockParserTest._test_clinicsu���#�D�)�)���M�(�V�4�4�4��(��^�^��	�'��&�q�M�M��	�&���7�7�5�>�>�������*�*�*�*�*rc�2�|�dd��dS)Nz�
    verbatim text here
    lah dee dah
/*[copy input]
def
[copy start generated code]*/
abc
/*[copy end generated code: output=03cfd743661f0797 input=7b18d017f89f61cf]*/
xyz
z�
    verbatim text here
    lah dee dah
/*[copy input]
def
[copy start generated code]*/
def
/*[copy end generated code: output=7b18d017f89f61cf input=7b18d017f89f61cf]*/
xyz
)r�r%s r�
test_clinic_1z#ClinicBlockParserTest.test_clinic_1	s.�����	�	�	�	�	�	�	rN)	rrrrsr�r�r�r�r�rrrr�r��sq������k�k�k�(�(�(����

�
�
�+�+�+�����rr�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d/d,�Z,d-�Z-d.S)0�ClinicParserTestc��tt����}tjd��}|�|��|j\}}|�d|j��|�d|j��dS)Nzmodule os
os.access�access�os)rr.r�Blockr`�
signaturesrdr
)r�parserr1rT�functions     r�test_trivialzClinicParserTest.test_trivial sx���:�<�<�(�(����3�4�4�����U���� �+��������8�=�1�1�1�����v�{�+�+�+�+�+rc��|�d��}|j\}}|�d|j��|�d|j��dS)Nz#
module os
os.accessr�r�)r`r�rdr
�rr1rTr�s    r�test_ignore_linez!ClinicParserTest.test_ignore_line(sW���
�
�4�5�5�� �+��������8�=�1�1�1�����v�{�+�+�+�+�+rc�P�|�d��}|�d|j��|�dt|j����|jd}|�d|j��|�|jtj��dS)Nz module os
os.access
   path: intr�r_�path)	�parse_functionrdr
�len�
parameters�assertIsInstance�	converterr�
int_converter�rr��ps   r�
test_paramzClinicParserTest.test_param.s����&�&�'K�L�L������8�=�1�1�1�����C�� 3�4�4�5�5�5����'��������(�(�(����a�k�6�+?�@�@�@�@�@rc��|�d��}|jd}|�d|j��dS)Nz4module os
os.access
    follow_symlinks: bool = True�follow_symlinksT�r�r�rdrr�s   r�test_param_defaultz#ClinicParserTest.test_param_default6sB���&�&�'_�`�`���� 1�2������q�y�)�)�)�)�)rc��|�d��}|jd}|�d|j��dS)NzCmodule os
os.access
    follow_symlinks: \
   bool \
   =\
    Truer�Tr�r�s   r�test_param_with_continuationsz.ClinicParserTest.test_param_with_continuations;sB���&�&�'t�u�u���� 1�2������q�y�)�)�)�)�)rc�*�|�d��}|jd}|�tj|j��|�d|jj��|�d��}|�|d��dS)NzOmodule os
os.access
    follow_symlinks: int(c_default='MAXSIZE') = sys.maxsizer��MAXSIZEz:module os
os.access
    follow_symlinks: int = sys.maxsizez~Error on line 0:
When you specify a named constant ('sys.maxsize') as your default value,
you MUST specify a valid c_default.
)	r�r�rdrL�maxsizerr��	c_default�parse_function_should_fail)rr�r��ss    r�test_param_default_expressionz.ClinicParserTest.test_param_default_expression@s����&�&�'z�{�{���� 1�2�������a�i�0�0�0�����A�K�$9�:�:�:��+�+�,j�k�k������`�	a�	a�	a�	a�	arc��|�d��}|jd}|�dt|j����|�|jdjtj��dS)NzR
module os
os.access
    follow_symlinks: bool = True
    something_else: str = ''r���something_else)r�r�rdr�r�r�r�
str_converterr�s   r�test_param_no_docstringz(ClinicParserTest.test_param_no_docstringIsx���&�&�( �!�!��

�� 1�2������C�� 3�4�4�5�5�5����h�1�2B�C�M�v�Oc�d�d�d�d�drc�\�|�d��}|�|d��dS)NzM
module os
os.access
    follow_symlinks: bool = True
    something_else: strzoError on line 0:
Can't have a parameter without a default ('something_else')
after a parameter with a default!
�r�rd�rr�s  r�*test_param_default_parameters_out_of_orderz;ClinicParserTest.test_param_default_parameters_out_of_orderSsG���+�+�-�
�
��
	
�����	�	�	�	�	rc��|�d��}|jd}|�d|jjd��dS)Nz0module os
os.access
    path: path_t(allow_fd=1)r���allow_fd)r�r�rdr�rr�s   r�!disabled_test_converter_argumentsz2ClinicParserTest.disabled_test_converter_arguments^sI���&�&�'[�\�\�����'������A�K�,�Z�8�9�9�9�9�9rc��|�d��}|�d���|j��dS)Nzx
module os
os.stat as os_stat_fn

   path: str
       Path to be examined

Perform a stat system call on the given path.zj
stat($module, /, path)
--

Perform a stat system call on the given path.

  path
    Path to be examined
�r�rd�strip�	docstring�rr�s  r�test_function_docstringz(ClinicParserTest.test_function_docstringcsU���&�&�(1�2�2��	
����
�E�G�G�X�
�	!�	!�	!�	!�	!rc��|�d��}|�d���|j��dS)Nz|
module foo
foo.bar
  x: int
     Documentation for x.
  y: int

This is the documentation for foo.

Okay, we're done here.
zt
bar($module, /, x, y)
--

This is the documentation for foo.

  x
    Documentation for x.

Okay, we're done here.
rrs  r�%test_explicit_parameters_in_docstringz6ClinicParserTest.test_explicit_parameters_in_docstringvsU���&�&�
(�
�
��	
���
�
�E�G�G�X�
�
	!�
	!�
	!�
	!�
	!rc�f�|�d��}|�d|j��dS)Nz<
module os
os.stat
    path: str
This/used to break Clinic!
z5stat($module, /, path)
--

This/used to break Clinic!)r�rdrrs  r�Ttest_parser_regression_special_character_in_parameter_column_of_docstring_first_linezeClinicParserTest.test_parser_regression_special_character_in_parameter_column_of_docstring_first_line�s?���&�&�(����	
���S�U]�Ug�h�h�h�h�hrc�f�|�d��}|�d|j��dS)Nzmodule os
os.stat as os_stat_fn�
os_stat_fn)r�rd�
c_basenamers  r�test_c_namezClinicParserTest.test_c_name�s5���&�&�'I�J�J������x�':�;�;�;�;�;rc�z�|�d��}|�|jtj��dS)Nzmodule os
os.stat -> int)r�r��return_converterr�int_return_converterrs  r�test_return_converterz&ClinicParserTest.test_return_converter�s8���&�&�'B�C�C�����h�7��9T�U�U�U�U�Urc���|�d��}|jd}|�tjj|j��|�d|j��dS)Nz:module os
os.access
    *
    follow_symlinks: bool = Truer�r)r�r�rd�inspect�	Parameter�KEYWORD_ONLY�kind�groupr�s   r�	test_starzClinicParserTest.test_star�s`���&�&�'f�g�g���� 1�2������*�7���@�@�@�����A�G�$�$�$�$�$rc��|�d��}|jd}|�d|j��dS)Nz/module window
window.border
 [
 ls : int
 ]
 /
�lsr�)r�r�rdrr�s   r�
test_groupzClinicParserTest.test_group�sA���&�&�'^�_�_�����%������A�G�$�$�$�$�$rc�b�|�d��}dD]W\}}|j|}|�|j|��|�|jt
jj���X|�|j�	��d�	����dS)Nz�
module curses
curses.addch
   [
   y: int
     Y-coordinate.
   x: int
     X-coordinate.
   ]
   ch: char
     Character to add.
   [
   attr: long
     Attributes for the character.
   ]
   /
))r|���)r{r�r}r)r~r�z�
addch([y, x,] ch, [attr])


  y
    Y-coordinate.
  x
    X-coordinate.
  ch
    Character to add.
  attr
    Attributes for the character.
            �
r�r�rdrrrr�POSITIONAL_ONLYrr�rr�r
rr�s     r�test_left_groupz ClinicParserTest.test_left_group�s����&�&�(����"�	H�	H�K�D�%�
�#�D�)�A����Q�W�e�,�,�,����Q�V�W�%6�%F�G�G�G�G�����+�1�1�3�3�6�����	�	�	�	�	rc�b�|�d��}dD]W\}}|j|}|�|j|��|�|jt
jj���X|�|j�	��d�	����dS)Na
module curses
curses.imaginary
   [
   [
   y1: int
     Y-coordinate.
   y2: int
     Y-coordinate.
   ]
   x1: int
     X-coordinate.
   x2: int
     X-coordinate.
   ]
   ch: char
     Character to add.
   [
   attr1: long
     Attributes for the character.
   attr2: long
     Attributes for the character.
   attr3: long
     Attributes for the character.
   [
   attr4: long
     Attributes for the character.
   attr5: long
     Attributes for the character.
   attr6: long
     Attributes for the character.
   ]
   ]
   /
))�y1���)�y2r&)�x1r)�x2rr)�attr1r�)�attr2r�)�attr3r�)�attr4r_)�attr5r_)�attr6r_a�
imaginary([[y1, y2,] x1, x2,] ch, [attr1, attr2, attr3, [attr4, attr5,
          attr6]])


  y1
    Y-coordinate.
  y2
    Y-coordinate.
  x1
    X-coordinate.
  x2
    X-coordinate.
  ch
    Character to add.
  attr1
    Attributes for the character.
  attr2
    Attributes for the character.
  attr3
    Attributes for the character.
  attr4
    Attributes for the character.
  attr5
    Attributes for the character.
  attr6
    Attributes for the character.
                r r"s     r�test_nested_groupsz#ClinicParserTest.test_nested_groups�s����&�&�"(�"�"��F�		H�		H�K�D�%��#�D�)�A����Q�W�e�,�,�,����Q�V�W�%6�%F�G�G�G�G�����+�1�1�3�3�6�6�E�G�G�7	�	�	�	�	rc��tj��5}|�t��5|�|��ddd��n#1swxYwYddd��n#1swxYwY|���Sr)r�captured_stdoutr��
SystemExitr�r�)rr��stdouts   rr�z+ClinicParserTest.parse_function_should_fails���
�
$�
&�
&�	'�&��"�"�:�.�.�
'�
'��#�#�A�&�&�&�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'����
'�
'�
'�
'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'���� � � s4�A(�A�A(�A	�A(�A	�A(�(A,�/A,c�\�|�d��}|�|d��dS)Nz|
module foo
foo.two_top_groups_on_left
    [
    group1 : int
    ]
    [
    group2 : int
    ]
    param: int
            zpError on line 0:
Function two_top_groups_on_left has an unsupported group configuration. (Unexpected state 2.b)
r�r�s  r�0test_disallowed_grouping__two_top_groups_on_leftzAClinicParserTest.test_disallowed_grouping__two_top_groups_on_left$sM���+�+�
-�

�

��	
����o�	q�	q�	q�	q�	qrc�0�|�d��dS)Nz}
module foo
foo.two_top_groups_on_right
    param: int
    [
    group1 : int
    ]
    [
    group2 : int
    ]
            �r�r%s r�1test_disallowed_grouping__two_top_groups_on_rightzBClinicParserTest.test_disallowed_grouping__two_top_groups_on_right4�)���'�'�
)�
	�
	�
	�
	�
	rc�0�|�d��dS)Nz�
module foo
foo.parameter_after_group_on_right
    param: int
    [
    [
    group1 : int
    ]
    group2 : int
    ]
            r8r%s r�8test_disallowed_grouping__parameter_after_group_on_rightzIClinicParserTest.test_disallowed_grouping__parameter_after_group_on_rightAr:rc�0�|�d��dS)Nz�
module foo
foo.group_after_parameter_on_left
    [
    group2 : int
    [
    group1 : int
    ]
    ]
    param: int
            r8r%s r�7test_disallowed_grouping__group_after_parameter_on_leftzHClinicParserTest.test_disallowed_grouping__group_after_parameter_on_leftNr:rc�0�|�d��dS)Nz`
module foo
foo.empty_group
    [
    [
    ]
    group2 : int
    ]
    param: int
            r8r%s r�-test_disallowed_grouping__empty_group_on_leftz>ClinicParserTest.test_disallowed_grouping__empty_group_on_left[�)���'�'�	)�		�		�		�		�		rc�0�|�d��dS)Nz`
module foo
foo.empty_group
    param: int
    [
    [
    ]
    group2 : int
    ]
            r8r%s r�.test_disallowed_grouping__empty_group_on_rightz?ClinicParserTest.test_disallowed_grouping__empty_group_on_rightgrArc��|�d��}|�d|j��|�dt|j����dS)Nz 
module foo
foo.bar

Docstring

zbar($module, /)
--

Docstringr��r�rdrr�r�rs  r�test_no_parametersz#ClinicParserTest.test_no_parametersss_���&�&�(����	
���;�X�=O�P�P�P�����C�� 3�4�4�5�5�5�5�5rc��|�ddd���}|�d|j��|�dt|j����dS)NzL
module foo
class foo.Bar "unused" "notneeded"
foo.Bar.__init__

Docstring

r�r_)�signatures_in_block�function_indexzBar()
--

Docstringr�rErs  r�test_init_with_no_parametersz-ClinicParserTest.test_init_with_no_parameters~sk���&�&�(��1�'�.�.��	
���1�8�3E�F�F�F�����C�� 3�4�4�5�5�5�5�5rc�0�|�d��dS)Nz!
module foo
foo.bar => int
    /
r8r%s r�test_illegal_module_linez)ClinicParserTest.test_illegal_module_line��)���'�'�)�	�	�	�	�	rc�0�|�d��dS)Nz!
module foo
foo.bar as 935
    /
r8r%s r�test_illegal_c_basenamez(ClinicParserTest.test_illegal_c_basename�rMrc�0�|�d��dS)Nz 
module foo
foo.bar
    *
    *
r8r%s r�test_single_starz!ClinicParserTest.test_single_star��)���'�'�)�	�	�	�	�	rc�0�|�d��dS)Nz
module foo
foo.bar
    *
r8r%s r�Ktest_parameters_required_after_star_without_initial_parameters_or_docstringz\ClinicParserTest.test_parameters_required_after_star_without_initial_parameters_or_docstring�rMrc�0�|�d��dS)Nz*
module foo
foo.bar
    *
Docstring here.
r8r%s r�Mtest_parameters_required_after_star_without_initial_parameters_with_docstringz^ClinicParserTest.test_parameters_required_after_star_without_initial_parameters_with_docstring�rRrc�0�|�d��dS)Nz(
module foo
foo.bar
    this: int
    *
r8r%s r�Mtest_parameters_required_after_star_with_initial_parameters_without_docstringz^ClinicParserTest.test_parameters_required_after_star_with_initial_parameters_without_docstring�rRrc�0�|�d��dS)Nz3
module foo
foo.bar
    this: int
    *
Docstring.
r8r%s r�Itest_parameters_required_after_star_with_initial_parameters_and_docstringzZClinicParserTest.test_parameters_required_after_star_with_initial_parameters_and_docstring�s)���'�'�)�	�	�	�	�	rc�0�|�d��dS)Nz 
module foo
foo.bar
    /
    /
r8r%s r�test_single_slashz"ClinicParserTest.test_single_slash�rRrc�0�|�d��dS)Nz<
module foo
foo.bar
   x: int
   y: int
   *
   z: int
   /
r8r%s r�test_mix_star_and_slashz(ClinicParserTest.test_mix_star_and_slash�s)���'�'�)�	�	�	�	�	rc�0�|�d��dS)Nz%
module foo
foo.bar
    /
    x: int
r8r%s r�1test_parameters_not_permitted_after_slash_for_nowzBClinicParserTest.test_parameters_not_permitted_after_slash_for_now�rRrc��|�d��}|�d���|j��dS)Nzk
  module foo
  foo.bar
    x: int
      Nested docstring here, goeth.
    *
    y: str
  Not at column 0!
zV
bar($module, /, x, *, y)
--

Not at column 0!

  x
    Nested docstring here, goeth.
rrs  r�test_function_not_at_column_0z.ClinicParserTest.test_function_not_at_column_0�sU���&�&�(����	
����
�E�G�G�X�
�	!�	!�	!�	!�	!rc����t��}t|���d�_�fd��jd<t	jd��}��|��|��j��dS)NFc�&��t�dd��S)N�flagT)�setattr)r�s�r�<lambda>z1ClinicParserTest.test_directive.<locals>.<lambda>�s�������0M�0M�r�setflag)r.rre�
directivesrr�r`�
assertTrue)rrer1r�s   @r�test_directivezClinicParserTest.test_directive�so����L�L���1�������'M�'M�'M�'M���)�$���Y�'�'�����U���������$�$�$�$�$rc��|�d��}|j\}}|�|jdjt
j��dS)Nz module os
os.access
   path: "s"r�)r`r�r�r�r�rr�r�s    r�test_legacy_convertersz'ClinicParserTest.test_legacy_converters�sK���
�
�?�@�@�� �+�������x�2�6�:�E�v�G[�\�\�\�\�\rc��t��}t|��}tj|��}|�|��|Sr)r.rrr�r`)r�textrer�r1s     rr`zClinicParserTest.parse�s<���L�L���1������T�"�"�����U�����rr_r�c��|�|��}|j}|�t|��|��||Sr)r`r�rdr�)rrorHrIr1r�s      rr�zClinicParserTest.parse_functionsE���
�
�4� � ���������Q���!4�5�5�5��� � rc���|�ttj��d��|�ttj��d��tj��5}|�t��5tj	ddd���ddd��n#1swxYwYddd��n#1swxYwY|�|�
��d��dS)Nz
<Unspecified>z<Null>zThe igloos are melting!z	clown.txt�E)r,�line_numberz>Error in file "clown.txt" on line 69:
The igloos are melting!
)rdrNr�unspecified�NULLrr2r�r3�failr�)rr4s  r�test_scaffoldingz!ClinicParserTest.test_scaffoldingsr������f�0�1�1�?�C�C�C�����f�k�*�*�H�5�5�5��
$�
&�
&�	]�&��"�"�:�.�.�
]�
]���5��Y[�\�\�\�\�
]�
]�
]�
]�
]�
]�
]�
]�
]�
]�
]����
]�
]�
]�
]�	]�	]�	]�	]�	]�	]�	]�	]�	]�	]�	]����	]�	]�	]�	]�	
������*�*�,n�o�o�o�o�os6�.C�	B-�!C�-B1	�1C�4B1	�5C�C�CN)r_r�).rrrr�r�r�r�r�r�r�r�rrrr
rrrrr#r0r�r6r9r<r>r@rCrFrJrLrOrQrTrVrXrZr\r^r`rbrkrmr`r�rwrrrr�r�s�������,�,�,�,�,�,�A�A�A�*�*�*�
*�*�*�
a�a�a�e�e�e�	�	�	�:�:�:�
!�!�!�&!�!�!�0i�i�i�<�<�<�V�V�V�%�%�%�%�%�%�
&�&�&�PJ�J�J�X!�!�!�q�q�q� ���������
�
�
�
�
�
�	6�	6�	6�6�6�6�������������������������	�	�	����!�!�!�(%�%�%�]�]�]�
���!�!�!�!�	p�	p�	p�	p�	prr�c��eZdZdZd�ZdS)�ClinicExternalTestNc��tjd��}t|dd���5}|���}ddd��n#1swxYwYt	j��5}tj�|d��}t|dd���5}|�	|��ddd��n#1swxYwYt
j
|��j}tj
|��t|dd���5}|���}ddd��n#1swxYwYt
j
|��j}ddd��n#1swxYwY|�||��|�||��dS)Nzclinic.testrpzutf-8)�encodingz
clinic.test.c�w)r�findfile�open�readr�temp_dirr�r��join�write�stat�st_mtime_nsr�
parse_filerd)	r�sourcer��
orig_contents�tmp_dir�testfile�old_mtime_ns�new_contents�new_mtime_nss	         r�
test_externalz ClinicExternalTest.test_externalsX���!�-�0�0��
�&�#��
0�
0�
0�	%�A��F�F�H�H�M�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��
�
!�
!�
	9�W��w�|�|�G�_�=�=�H��h��g�6�6�6�
'�!����
�&�&�&�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'����
'�
'�
'�
'��7�8�,�,�8�L���h�'�'�'��h��g�6�6�6�
(�!� �v�v�x�x��
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(��7�8�,�,�8�L�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9����
	9�
	9�
	9�
	9�	
����}�5�5�5�	
����|�4�4�4�4�4sl�A�A�A�&3E�B;�/E�;B?	�?E�B?	�AE�D&�E�&D*	�*E�-D*	�.E�E�E)rrr�maxDiffr�rrrryrys(�������G�5�5�5�5�5rry�__main__) �testrr�test.supportr�unittestrrAr�os.pathr�rL�skip_if_missing�imports_under_toolrrr
rr"rYrer.r\rkr�r�r�r�r�ryr�mainrrr�<module>r�sT��
%�$�$�$�$�$�$�$�"�"�"�"�"�"�������������������
�
�
�
������
��8�$�$�$�"�Z�"�8�,�,�!�!��M�M�M� � � � � � �!�!�!�!�!�!�!�!�!�!�!����!�!�!�!�
��������0�0�0�0�0�0�0�0�Q�Q�Q�Q�Q�Q�Q�Q��F�M�3�6�2�2�2��-8�-8�-8�-8�-8�-8�-8�-8�^1�1�1�1�1�(�1�1�1�*-.�-.�-.�-.�-.�h�-.�-.�-.�`2(�2(�2(�2(�2(�X�2(�2(�2(�h
�
�
�
�
�
�
�
�#�#�#�#�#�#�#�#�:�:�:�:�:�H�:�:�:�zxp�xp�xp�xp�xp�x�xp�xp�xp�v5�5�5�5�5��5�5�5�:�z����H�M�O�O�O�O�O��s�	A � A$�'A$