
    h,                     T    S r SSKrSSKJrJr  SSKJr  S	S jrS	S jrS	S jr	S	S jr
g)
z%Tests for generic docstring routines.    N)DocstringStyle
ParseError)parsec                     [        S5      n U R                  [        R                  :X  d   eU R                  S:X  d   eU R
                  S:X  d   eU R                  S:X  d   e[        U R                  5      S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  b   eU R                  S   R                  S	:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   e[        U R                  5      S
:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  c   eU R                  R                  S:X  d   eU R                  R                  S:X  d   eU R                  c   e[        U R                  5      S
:X  d   eU R                  S   U R                  :X  d   eg)z%Test ReST-style parser autodetection.a  
        Short description

        Long description

        Causing people to indent:

            A lot sometimes

        :param spam: spam desc
        :param int bla: bla desc
        :param str yay:
        :raises ValueError: exc desc
        :returns tuple: ret desc
        Short description@Long description

Causing people to indent:

    A lot sometimesSShort description

Long description

Causing people to indent:

    A lot sometimes   r   spamN	spam desc   blaintbla desc   yaystr 
ValueErrorexc desctupleret desc)r   styler   RESTshort_descriptionlong_descriptiondescriptionlenparamsarg_name	type_nameraisesreturnsmany_returns	docstrings    \/home/james-whalen/.local/lib/python3.13/site-packages/docstring_parser/tests/test_parser.py	test_restr(      s   	I$ ??n11111&&*====%%	  
   	   y A%%%A''6111A((000A**k999A''5000A((E111A**j888A''5000A((E111A**b000y A%%%A((L888A**j888(((&&'111((J666!!---y%%&!+++!!!$	(9(9999    c                     [        S5      n U R                  [        R                  :X  d   eU R                  S:X  d   eU R
                  S:X  d   eU R                  S:X  d   e[        U R                  5      S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  b   eU R                  S   R                  S	:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   e[        U R                  5      S
:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  c   eU R                  R                  S:X  d   eU R                  R                  S:X  d   eU R                  c   e[        U R                  5      S
:X  d   eU R                  S   U R                  :X  d   eg)z'Test Google-style parser autodetection.a6  Short description

        Long description

        Causing people to indent:

            A lot sometimes

        Args:
            spam: spam desc
            bla (int): bla desc
            yay (str):

        Raises:
            ValueError: exc desc

        Returns:
            tuple: ret desc
        r   r   r	   r
   r   r   Nr   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   GOOGLEr   r   r   r   r   r    r!   r"   r#   r$   r%   s    r'   test_googler,   >   s   	I, ??n33333&&*====%%	  
   	   y A%%%A''6111A((000A**k999A''5000A((E111A**j888A''5000A((E111A**b000y A%%%A((L888A**j888(((&&'111((J666!!---y%%&!+++!!!$	(9(9999r)   c                     [        S5      n U R                  [        R                  :X  d   eU R                  S:X  d   eU R
                  S:X  d   eU R                  S:X  d   e[        U R                  5      S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  b   eU R                  S   R                  S	:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S
   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  b   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  (       d   eU R                  S   R                  S:X  d   e[        U R                  5      S
:X  d   eU R                  S   R                  S:X  d   eU R                  S   R                  S:X  d   eU R                  c   eU R                  R                  S:X  d   eU R                  R                  S:X  d   eU R                  c   e[        U R                  5      S
:X  d   eU R                  S   U R                  :X  d   eg)z)Test numpydoc-style parser autodetection.a  Short description

        Long description

        Causing people to indent:

            A lot sometimes

        Parameters
        ----------
        spam
            spam desc
        bla : int
            bla desc
        yay : str

        Raises
        ------
        ValueError
            exc desc

        Other Parameters
        ----------------
        this_guy : int, optional
            you know him

        Returns
        -------
        tuple
            ret desc

        See Also
        --------
        multiple lines...
        something else?

        Warnings
        --------
        multiple lines...
        none of this is real!
        r   r   r	      r   r   Nr   r   r   r   r   r   r   r   r
   this_guyzyou know himr   r   r   r   )r   r   r   NUMPYDOCr   r   r   r   r   r    r!   is_optionalr"   r#   r$   r%   s    r'   test_numpydocr2   x   s	   (	*IX ??n55555&&*====%%	  
   	   y A%%%A''6111A((000A**k999A''5000A((E111A**j888A''5000A((E111A**222A'':555A((E111A****A**n<<<y A%%%A((L888A**j888(((&&'111((J666!!---y%%&!+++!!!$	(9(9999r)   c                     Sn [         R                  " [        5         [        U [        R
                  5        SSS5        [        U 5      nU(       d   eUR                  [        R                  :X  d   eg! , (       d  f       NC= f)zaTest autodection for the case where one of the parsers throws an error
and another one succeeds.
z=
    Does something useless

    :param 3 + 3 a: a param
    N)pytestr"   r   r   r   r   r   r+   )sourcer&   s     r'   "test_autodetection_error_detectionr6      s`    F 
z	"fn))* 
#
 fI9??n33333 
#	"s   A55
B)returnN)__doc__r4   docstring_parser.commonr   r   docstring_parser.parserr   r(   r,   r2   r6    r)   r'   <module>r<      s)    +  > )3:l7:tR:j4r)   