
    |hW
                     |    d Z ddlmZ ddlmZ dZ G d dej
                        Zedk(  r ej                          yy)	zTests for formatting.py.    )
formatting)	testutilsP   c                   H    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)FormattingTestc                 V    t        j                  d      }| j                  |ddg       y )Nhelloz[1mhello[0m)r   BoldassertInselftexts     S/var/www/html/test/engine/venv/lib/python3.12/site-packages/fire/formatting_test.py	test_boldzFormattingTest.test_bold   s$    ??7#DMM$"789    c                 V    t        j                  d      }| j                  |ddg       y )Nr	   z[4mhello[0m)r   	Underliner   r   s     r   test_underlinezFormattingTest.test_underline   s&    (DMM$"789r   c                 V    t        j                  dd      }| j                  d|       y )Nr	      spacesz  hellor   IndentassertEqualr   s     r   test_indentzFormattingTest.test_indent!   s$    WQ/DY%r   c                 V    t        j                  dd      }| j                  d|       y )Nzhello
worldr   r   z  hello
  worldr   r   s     r   test_indent_multiple_linesz)FormattingTest.test_indent_multiple_lines%   s%    ^A6D'.r   c                 V    t        j                  dg      }| j                  dg|       y )Nricer   WrappedJoinr   r   liness     r   test_wrap_one_itemz!FormattingTest.test_wrap_one_item)   s&    ""F8,EfXu%r   c                 ^    t        j                  g dd      }| j                  g d|       y )N)r    beanschickencheese   )width)zrice | beans |z	chicken |r)   r!   r#   s     r   test_wrap_multiple_itemsz'FormattingTest.test_wrap_multiple_items-   s.    ""#I)+-E  !&(r   c                 d    d}t        j                  |dt              }| j                  d|       y )NThis is a string
   r   available_spaceline_lengthz
This is...r   EllipsisTruncateLINE_LENGTHr   r   r   truncated_texts      r   test_ellipsis_truncatez%FormattingTest.test_ellipsis_truncate4   s/    D002;@N\>2r   c                 d    d}t        j                  |dt              }| j                  d|       y )Nr.   r   r0   r3   r6   s      r   'test_ellipsis_truncate_not_enough_spacez6FormattingTest.test_ellipsis_truncate_not_enough_space:   s/    D001+?N'8r   c                 d    d}t        j                  |dt              }| j                  d|       y )N1000000000L   r0   z10...0Lr   EllipsisMiddleTruncater5   r   r6   s      r   test_ellipsis_middle_truncatez,FormattingTest.test_ellipsis_middle_truncate@   s.    D661+?NY/r   c                 d    d}t        j                  |dt              }| j                  d|       y )Nr<   r   r0   r>   r6   s      r   .test_ellipsis_middle_truncate_not_enough_spacez=FormattingTest.test_ellipsis_middle_truncate_not_enough_spaceF   s.    D661+?N]N3r   N)__name__
__module____qualname__r   r   r   r   r%   r,   r8   r:   r@   rB    r   r   r   r      s4    ::&/&(3904r   r   __main__N)	__doc__firer   r   r5   BaseTestCaser   rC   mainrF   r   r   <module>rL      sC      34Y++ 34l z).. r   