
    daf                     `    d dl Z d dlmZmZ  G d d      Z G d dee      Z G d dee      Zy)	    N)PyTestCTestc                   $    e Zd Zd Zd Zd Zd Zy)	TestFloatc                 0   dt         j                  t         j                  dz  t         j                  dz  dfD ]\  }| j                  t        | j	                  |            |       | j                  | j                  | j	                  |            |       ^ y )NgAd   ig@)mathpiassertEqualfloatdumpsloadsselfnums     4/root/Python-3.12.4/Lib/test/test_json/test_float.pytest_floatszTestFloat.test_floats   sn    &#tww}cR 	?CU4::c?3S9TZZ

38#>	?    c                     dD ]V  }| j                  | j                  |      t        |             | j                  t        | j                  |            |       X y )N)   l        l            )r   r   strintr   s     r   	test_intszTestFloat.test_ints   sJ    $ 	8CTZZ_c#h7SC137	8r   c                     | j                  | j                  d      t        d      g       | j                  | j                  d      t        d      g       y )Nz[23456789012E666]infz[-23456789012E666]-inf)r   r   r   )r   s    r   test_out_of_rangezTestFloat.test_out_of_range   sB    $785<.I$89E&M?Kr   c                    t        d      t        d      t        d      fD ]  }| j                  |g      }||k(  r#| j                  | j                  |      |g       nD| j                  |      }| j                  t	        |      d       | j                  |d   |d          d| }| j                  t        || j                  |gd        y )	Nr   r   nanr   r   z2Out of range float values are not JSON compliant: F)	allow_nan)r   r   r   r   lenassertNotEqualassertRaisesRegex
ValueError)r   valoutresmsgs        r   test_allow_nanzTestFloat.test_allow_nan   s    %L%-u> 		XC**cU#Ccz  C3%8jjo  S1-##CFCF3FseLC"":sDJJQV"W		Xr   N)__name__
__module____qualname__r   r   r   r)    r   r   r   r      s    ?
8
L
Xr   r   c                       e Zd Zy)TestPyFloatNr*   r+   r,   r-   r   r   r/   r/   !       r   r/   c                       e Zd Zy)
TestCFloatNr0   r-   r   r   r3   r3   "   r1   r   r3   )r	   test.test_jsonr   r   r   r/   r3   r-   r   r   <module>r5      s-     (X X8 +)V * (E (r   