o
    
i	                     @   s   d dl Z d dlmZmZmZmZmZ dd Zdd Zdd Z	e j
d	d
d
gfddgfdddgfgdd Zdd Zdd ZdS )    N)colordiff_stringsformat_reprlocale_escapewrapc                   C   sn   t ddddks
J t ddddksJ t dddd	ksJ t dd
dddks)J t ddd
dddks5J d S )Ntestgreen)fgz[38;5;2mtest[0m   z[38;5;4mtest[0mT)boldz[1mtest[0mred)r	   	underlinez[4;38;5;1mtest[0m   )r	   bgr   z[1;38;5;7;48;5;1mtest[0m)r    r   r   J/home/ubuntu/.local/lib/python3.10/site-packages/wasabi/tests/test_util.py
test_color   s
   r   c                  C   s\   d} t | dd| ksJ t | dddksJ t | ddddks!J t | d	d
ddks,J d S )NzHello world, this is a test.r   )indentr
   z     Hello world, this is a test.
   )wrap_maxr   zHello
world,
this is a
test.      z(  Hello
  world,
  this
  is
  a
  test.)r   )textr   r   r   	test_wrap   s   r   c                  C   sl   ddd} t | }|dddv sJ t | dd}|ddd	v s#J t | dd
d}|dddv s4J d S )Nworld{   )hellor   zu'')z{'hello': 'world', 'test': 123}z{'test': 123, 'hello': 'world'}r   )max_len)z{'hel ...  123}z{'tes ... rld'}z{'te ... rld'}z[...])r   ellipsis)z{'hel [...]  123}z{'tes [...] rld'}z{'te [...] rld'})r   replace)obj	formattedr   r   r   test_format_repr   s   
r#   ztext,non_asciiabcu   ✔ abcz? abcu   👻z???c                 C   s(   t | }|| ks||v sJ t| d S )N)r   print)r   	non_asciiresultr   r   r   test_locale_escape0   s   	r)   c                  C   s"   d} d}d}t | ||ksJ d S )Nhello
world
wide
webyo
wide
world
webzp[38;5;16;48;5;2myo[0m
[38;5;16;48;5;2mwide[0m
[38;5;16;48;5;1mhello[0m
world
[38;5;16;48;5;1mwide[0m
webr   abexpectedr   r   r   test_diff_strings>   s   r1   c                  C   s&   d} d}d}t | |dd|ksJ d S )Nr*   r+   zx[38;5;16;48;5;2m+ yo[0m
[38;5;16;48;5;2m+ wide[0m
[38;5;16;48;5;1m- hello[0m
world
[38;5;16;48;5;1m- wide[0m
webT)add_symbolsr,   r-   r   r   r   test_diff_strings_with_symbolsE   s   r3   )pytestwasabi.utilr   r   r   r   r   r   r   r#   markparametrizer)   r1   r3   r   r   r   r   <module>   s    


