
    Bwgx                         d dl Z d dlZddlmZ  G d dej
                        Z G d dej
                        Z G d d	ej
                        Zy)
    N   )utilc                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)
TestStringtestssrcstringzchar.f90c                 P   t        j                  g dd      j                  }| j                  j                  j                  ||j                  d         \  }}|t        j                  |      k(  sJ |j                         }d|dd d f<   |t        j                  |      k(  sJ y )N)abcdefc)dtyper   AAA)
nparrayTmodule	char_testchange_stringsshapepytestapproxcopy)selfstringsinpoutexpecteds        S/var/www/horilla/myenv/lib/python3.12/site-packages/numpy/f2py/tests/test_string.py	test_charzTestString.test_char	   s    ((-S9;;;;((77W]]1%'SfmmG,,,,<<>AfmmH----    N)
__name__
__module____qualname__r   getpathsourcesr   markslowr!    r"   r    r   r      s7    t||GUHjABG[[. .r"   r   c                   >    e Zd Z ej                  dddd      gZd Zy)TestDocStringArgumentsr   r   r	   zstring.fc                    t        j                  d      }t        j                  d      }t        j                  d      }t        j                  d      }| j                  j                  ||||       |j	                         dk(  sJ |j	                         dk(  sJ |j	                         dk(  sJ |j	                         dk(  sJ y )Ns   123  s   123s   B23  s   D23)r   r   r   footobytes)r   abr   ds        r    test_examplez#TestDocStringArguments.test_example   s    HHZ HHZ HHVHHV1a#yy{j(((yy{j(((yy{f$$$yy{f$$$r"   N)r#   r$   r%   r   r&   r'   r3   r*   r"   r    r,   r,      s     t||GUHjABG%r"   r,   c                   ^    e Zd Z ej                  dddd      gZed
d       ZddZd Z	d	 Z
y)TestFixedStringr   r   r	   zfixed_string.f90Nc           	      B   t        | t        j                        r| j                         } n t        | t              r| j                         } t        | t              sJ |t        |       }d}t        |t        |t        |                   D ]  }|| |   d|z  z  z  } |S )zReturn the content of a string buffer as integer value.

        For example:
          _sint('1234') -> 4321
          _sint('123A') -> 17321
        r   
   )

isinstancer   ndarrayr/   strencodebyteslenrangemin)sstartendijs        r    _sintzTestFixedString._sint(   s     a$		A3
A!U###;a&Cuc#s1v./ 	A1AA	r"   c              #   ,  K   |dv r,d d d d d d d d	 d
 d d t        j                  dt         j                  d       t        j                  d       t        j                  d       t        j                  d       t        j                  d
       t        j                  d	       t        j                  d       t        j                  d       t        j                  d       y w)Nin 1123412345r"          1   s   1 s   1234s   12345r*   )buffers   123 )r   r9   bytes_r   )r   intents     r    
_get_inputzTestFixedString._get_input<   s     VHILMIKJLLMNjjRYYs33hhsmhhuohhtnhhvhhvhhwhhx  hhx  s   DDc                     | j                         D ]<  }| j                  j                  |      }| j                  |d      }||k(  r7J |        y )N   rB   )rS   r   test_in_bytes4rE   )r   r@   rr   s       r    test_intent_inzTestFixedString.test_intent_inS   sO    " 	$A**1-Azz!z+H=#!#=		$r"   c                     | j                  d      D ]b  }| j                  |d      }| j                  j                  |      }| j                  |d      }||k(  sJ || j                  |d      k(  rbJ  y )Ninout)rR   rU   )rA   rV   )rS   rE   r   test_inout_bytes4)r   r@   restrX   r   s        r    test_intent_inoutz!TestFixedString.test_intent_inoutZ   s}    0 	2A::aq:)D--a0Azz!z+H= = 4::aq:1111	2r"   )r   NrG   )r#   r$   r%   r   r&   r'   staticmethodrE   rS   rY   r^   r*   r"   r    r5   r5   %   s=    t||GUH6HIJG &!.$2r"   r5   )	r   numpyr   rI   r   F2PyTestr   r,   r5   r*   r"   r    <module>rb      s>      . .%T]] %"=2dmm =2r"   