o
    
i                     @   s:   d dl mZ d dlZd dlZefddZG dd dZdS )    )print_functionNc                 C   s`   dd l }d|  }td|  t| t|}t|d |sJ |j||jj}t| |d S )Nr   z{"low": %s }zinput: [%s]low)	srsly.ruamel_yamlprintreprjsonloads
isinstanceruamel_yamlloadRoundTripLoader)stypsrslyxresret_val r   ]/home/ubuntu/.local/lib/python3.10/site-packages/srsly/tests/ruamel_yaml/test_json_numbers.pyr   
   s   
r   c                   @   s   e Zd Zdd Zdd ZdS )TestJSONNumbersc                 C   s8   dd d  D D ]}|sq	t|}t|tsJ q	d S )Nc                 s   "    | ]}| d d  V  qdS #r   Nsplitstrip.0yr   r   r   	<genexpr>   
    
z9TestJSONNumbers.test_json_number_float.<locals>.<genexpr>z
        1.0  # should fail on YAML spec on 1-9 allowed as single digit
        -1.0
        1e-06
        3.1e-5
        3.1e+5
        3.1e5  # should fail on YAML spec: no +- after e
        )
splitlinesr   r	   floatselfr   r   r   r   r   test_json_number_float   s   
z&TestJSONNumbers.test_json_number_floatc                 C   s:   dd d  D D ]}|sq	t|t}t|tsJ q	d S )Nc                 s   r   r   r   r   r   r   r   r   0   r    z7TestJSONNumbers.test_json_number_int.<locals>.<genexpr>z
        42
        )r!   r   intr	   r#   r   r   r   test_json_number_int/   s   

z$TestJSONNumbers.test_json_number_intN)__name__
__module____qualname__r%   r'   r   r   r   r   r      s    r   )
__future__r   pytestr   r"   r   r   r   r   r   r   <module>   s
   