HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_textwrap.cpython-310.opt-2.pyc
o

�i���@s�ddlZddlmZmZmZmZmZmZGdd�dej�Z	Gdd�de	�Z
Gdd�de	�ZGd	d
�d
e	�ZGdd�de	�Z
Gd
d�de	�ZGdd�dej�ZGdd�dej�ZGdd�de	�Zedkrie��dSdS)�N)�TextWrapper�wrap�fill�dedent�indent�shortenc@s.eZdZ	dd�Zdd�Zdd�Zdd�Zd	S)
�BaseTestCasecCsjt|t�r(g}tt|��D]
}|�d|||f�q
|r$d�|�}|Sd}|St|t�r3dt|�}|S)Nz  %d: %r�
z
  no linesz  %s
)�
isinstance�list�range�len�append�join�str�repr)�selfZtextin�result�i�r�//usr/local/lib/python3.10/test/test_textwrap.py�shows
�
�zBaseTestCase.showc	Cs&|�||d|�|�|�|�f�dS)Nzexpected:
%s
but got:
%s)�assertEqualr)rr�expectrrr�checks
��zBaseTestCase.checkcK�"t||fi|��}|�||�dS�N)rr�r�text�widthr�kwargsrrrr�
check_wrap#�zBaseTestCase.check_wrapcCs&|j�|�}|�||d||f�dS)Nz
expected %r
but got  %r)�wrapper�_splitr)rrrrrrr�check_split's��zBaseTestCase.check_splitN)�__name__�
__module__�__qualname__rrr!r%rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=S)>�WrapTestCasecCstdd�|_dS)N�-)r)rr#�rrrr�setUp0szWrapTestCase.setUpcCs<d}|�|dgd��|�|dddg�|�|d|g�dS)N�=Hello there, how are you this fine day?  I'm glad to hear it!���Hello there,�how are you�	this finez	day?  I'mzglad to hearzit!�*z'Hello there, how are you this fine day?zI'm glad to hear it!�P�r!�rrrrr�test_simple3s���zWrapTestCase.test_simplecCs$|�ddg�|jddgdd�dS)N��F��drop_whitespacer5r+rrr�test_empty_stringDszWrapTestCase.test_empty_stringcCs*|jddgdd�|jddgddd�dS)Nr8r9�++��initial_indentF)r?r;r5r+rrr�%test_empty_string_with_initial_indentIsz2WrapTestCase.test_empty_string_with_initial_indentcCs�d}gd�}tddd�}|�|�}|�||�|�|�}|�|d�|��d}dg}|�|d	|�d
}dg}|j|d	|dd
�dS)Nz�This is a paragraph that already has
line breaks.  But some of its lines are much longer than the others,
so it needs to be wrapped.
Some lines are 	tabbed too.
What a mess!
)z)This is a paragraph that already has linez'breaks.  But some of its lines are muchz)longer than the others, so it needs to bez-wrapped.  Some lines are  tabbed too.  What azmess!r*T�Zfix_sentence_endingsr	z	Test	default		tabsize.z(        Test    default         tabsize.r4z	Test	custom		tabsize.z     Test    custom      tabsize.�)�tabsize)rrrrrr!)rrrr#rrrr�test_whitespaceNs

zWrapTestCase.test_whitespacecCs�tddd�}d}dg}|�|�|�|�d}dg}|�|�|�|�d}|�|�|�|�d	}d
g}|�|�|�|�d|_gd�}|�|�|�|�d
}gd�}|�|�|�|�d|_dg}|�|�|�|�d}dg}|�|�|�|�dS)N�<TrAz$A short line. Note the single space.z%A short line.  Note the single space.z Well, Doctor? What do you think?z!Well, Doctor?  What do you think?z Well, Doctor?
What do you think?z)I say, chaps! Anyone for "tennis?"
Hmmph!z+I say, chaps!  Anyone for "tennis?"  Hmmph!�)z
I say, chaps!zAnyone for "tennis?"zHmmph!z1And she said, "Go to hell!"
Can you believe that?)zAnd she said, "Go tozhell!"  Can youz
believe that?z2And she said, "Go to hell!"  Can you believe that?zFile stdio.h is nice.)rrrr)rr#rrrrr�test_fix_sentence_endingsns0z&WrapTestCase.test_fix_sentence_endingscCs*d}|�|dddg�|�|ddg�dS)NzThis is a
short paragraph.rFzThis is a shortz
paragraph.�(zThis is a short paragraph.r5r6rrr�test_wrap_short�s

�zWrapTestCase.test_wrap_shortcCs,d}|�|ddg�|j|ddgdd�dS)NzThis is a short line.�z(1) This is a short line.z(1) r>r5r6rrr�test_wrap_short_1line�s

�z"WrapTestCase.test_wrap_short_1linecCs�d}|�|dddg�|�|dddg�|�|dddg�d	�d
�}|j|d|dd
�|�||�|�ddg�|�ddg�|�dd�d
��dS)NzBthis-is-a-useful-feature-for-reformatting-posts-from-tim-peters'lyrHzthis-is-a-useful-feature-for-z%reformatting-posts-from-tim-peters'ly�)r3z*this-is-a-useful-feature-for-reformatting-zposts-from-tim-peters'lyzLthis-|is-|a-|useful-|feature-|for-|reformatting-|posts-|from-|tim-|peters'ly�|�F��break_long_wordsze-mailzJelly-Ozhalf-a-crownzhalf-|a-|crown)r!�splitr%�rrrrrr�test_hyphenated�s0�������zWrapTestCase.test_hyphenatedcCs�d}|�|dgd��|�|dddg�|j|d|��dd	�d
}|�|ddd
g�|�|ddd
g�|�|dd
g�|j|d|��dd	�dS)NzRPython 1.0.0 was released on 1994-01-26.  Python 1.0.1 was
released on 1994-02-15.rJ)zPython 1.0.0 was released onz1994-01-26.  Python 1.0.1 waszreleased on 1994-02-15.rHz(Python 1.0.0 was released on 1994-01-26.z(Python 1.0.1 was released on 1994-02-15.rNFrOzI do all my shopping at 7-11.�zI do all my shopping atz7-11.��)r!rQr6rrr�test_hyphenated_numbers�s
�
�
�z$WrapTestCase.test_hyphenated_numberscCs$d}|�|dddg�|�|dddg�dd	g}|�|d
|�|�|d|�|�|ddg�d
}gd�}|�|d|�|�|d|�gd�}|�|d|�|�|d|�ddg}|�|d|�|�|d|�ddg}|�|d|�|�|d|�d}gd�}|�||�d}gd�}|�||�dS)Nz$Em-dashes should be written -- thus.rTzEm-dashes should bezwritten -- thus.rVzEm-dashes should be writtenz-- thus.zEm-dashes should be written --zthus.rJ�#�$z%You can also do--this or even---this.)zYou can also doz--this or even�---this.��)zYou can also do--zthis or even---�this.��zYou can also do--this or evenrZ�z You can also do--this or even---r]� z7Here's an -- em-dash and--here's another---and another!)zHere's� Zanrb�--rbzem-Zdashrb�andrczhere'srbZanotherz---rdrbzanother!zand then--bam!--he was gone)rdrbZthenrczbam!rc�herbZwasrbZgone�r!r%rRrrr�test_em_dash�sT��������zWrapTestCase.test_em_dashcCs�d}|�|dgd��|�|dgd��ddg}|�|d|�|�|d	|�|�|d
|�|�|d|�dd
g}|�|d|�|�|d|�ddg}|�|d|�d}gd�}|�||�dS)Nz<You should use the -n option, or --dry-run in its long form.rF)zYou should use thez-n option, or --dry-zrun in its longzform.�)zYou should use the -nzoption, or --dry-run�in its long form.z You should use the -n option, orz--dry-run in its long form.ra�"rX�&z'You should use the -n option, or --dry-zrun in its long form.�'rLz*You should use the -n option, or --dry-runrir3z'the -n option, or --dry-run or --dryrun)�therbz-nrbzoption,rb�orrbz--dry-�runrbrnrbz--dryrunrfrRrrr�test_unix_optionss4�����zWrapTestCase.test_unix_optionscCsp|�dgd��|�dgd��|�dgd��|�ddg�|�ddg�|�d	d
dg�|�dgd
��dS)Nzwhat the--hey!)�whatrbrmrczhey!z
what the--)rqrbzthe--zwhat the--.)rqrbzthe--.z	--text--.z--optionz--option-opt�	--option-�optzfoo --option-opt bar)�foorbrrrsrb�bar�r%r+rrr�test_funky_hyphens3s�zWrapTestCase.test_funky_hyphenscCsV|�dgd��|�dgd��|�dgd��|�dgd��|�d	d
�d��dS)Nzthe 'wibble-wobble' widget)rmrbz'wibble-zwobble'rb�widgetzthe "wibble-wobble" widget)rmrbz"wibble-zwobble"rbrxzthe (wibble-wobble) widget)rmrbz(wibble-zwobble)rbrxzthe ['wibble-wobble'] widget)rmrbz	['wibble-zwobble']rbrxzwhat-d'you-call-it.zwhat-d'you-|call-|it.rM)r%rQr+rrr�test_punct_hyphensDs�����zWrapTestCase.test_punct_hyphenscCs4|�dgd��|�dgd��|�dgd��dS)Nzfoo (--option) bar)rtrbz
(--option)rbruz
foo (bar) baz)rtrbz(bar)rbZbazzblah (ding dong), wubba)Zblahrbz(dingrbzdong),rbZwubbarvr+rrr�test_funky_parensYs���zWrapTestCase.test_funky_parenscCsd}|j|dgd�dd�dS)Nz0 This is a    sentence with     much whitespace.�
)z
 This is a�    z	sentence z	with     z
much whitezspace.Fr:r5r6rrr�test_drop_whitespace_falsefs

�z'WrapTestCase.test_drop_whitespace_falsecCs|jdddgdd�dS)N�   r9Fr:r5r+rrr�*test_drop_whitespace_false_whitespace_onlyosz7WrapTestCase.test_drop_whitespace_false_whitespace_onlycCs|jdddgddd�dS)Nr~r9�     F�  )r;r?r5r+rrr�6test_drop_whitespace_false_whitespace_only_with_indentss
�zCWrapTestCase.test_drop_whitespace_false_whitespace_only_with_indentcCs|�ddg�dS)Nr�r9r5r+rrr�$test_drop_whitespace_whitespace_onlyysz1WrapTestCase.test_drop_whitespace_whitespace_onlycCs*d}|�|ddg�|�|dddg�dS)Nz, This is a sentence with leading whitespace.�2rJz This is a sentence withzleading whitespace.r5r6rrr�'test_drop_whitespace_leading_whitespace}s��z4WrapTestCase.test_drop_whitespace_leading_whitespacecCs0d}|j|dgd�dd�|�|dddg�dS)Nzabcd    efghr9)�abcdr|�efghFr:r�r�r5r6rrr�$test_drop_whitespace_whitespace_line�s
�z1WrapTestCase.test_drop_whitespace_whitespace_linecCs|jddgdd�dS)Nr�r9r=r>r5r+rrr�0test_drop_whitespace_whitespace_only_with_indent�sz=WrapTestCase.test_drop_whitespace_whitespace_only_with_indentcCs|jddddgddd�dS)Nz	abcd efghr9z  abcdz  efghr��r?�subsequent_indentr5r+rrr�&test_drop_whitespace_whitespace_indent�s
�z3WrapTestCase.test_drop_whitespace_whitespace_indentcCs$d}|j�|�}|�|gd��dS)Nz0Hello there -- you goof-ball, use the -b option!)�HellorbZthererbrcrbZyourbzgoof-zball,rbZuserbrmrbz-brbzoption!)r#r$r)rrrrrr�
test_split�s
�zWrapTestCase.test_splitcCs4d}|j|dddgdd�|j|dddgd	d�dS)
Nz
yaba daba-door{z
yaba daba-ZdooT��break_on_hyphensZyabazdaba-dooFr5r6rrr�test_break_on_hyphens�s�
�z"WrapTestCase.test_break_on_hyphenscCs(d}|�tt|d�|�tt|d�dS)NzWhatever, it doesn't matter.r���)�assertRaises�
ValueErrorrr6rrr�test_bad_width�szWrapTestCase.test_bad_widthcCsd}|�|dgd��dS)NuDie Empfänger-Auswahl�
)ZDieuEmpfänger-ZAuswahlr5r6rrr�test_no_split_at_umlaut��z$WrapTestCase.test_no_split_at_umlautcCsd}|�|dddg�dS)Nuaa ää-ää�uaa ää-uäär5r6rrr�test_umlaut_followed_by_dash�r�z)WrapTestCase.test_umlaut_followed_by_dashcC�4d}|j|dgd�dd�|j|dgd�dd�dS)Nu,This is a sentence with non-breaking space.rF)�This is a sentence�	with non-ubreaking space.Tr�)r��withunon-breaking space.Fr5r6rrr�test_non_breaking_space�s�
�z$WrapTestCase.test_non_breaking_spacecCr�)Nu-This is a sentence with non-breaking space.rF)r�r�ubreaking space.Tr�)r�r�unon-breaking space.Fr5r6rrr�test_narrow_non_breaking_space�s�
�z+WrapTestCase.test_narrow_non_breaking_spaceN)!r&r'r(r,r7r<r@rDrGrIrKrSrWrgrprwryrzr}rr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr).s> *

7"
		r)c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�MaxLinesTestCaser-cCs�|j|jddgdd�|j|jddgdd�|j|jdddgdd�|j|jd	dd
gdd�|j|jd|jgdd�|j|jdgd�d
d�dS)Nr.zHello [...]r��	max_linesrNr0z	how [...]�r�z
how are [...]r4r/r9�r!rr+rrrr7�s2
�
�
��
��

�zMaxLinesTestCase.test_simplecCsP|j|jdgd�dd�|j|jdddgdd�|j|jd	dgd
�dd�dS)Nr.)r0r1r2z
day? [...]rBr�r9r��[...]r�z
          r/r�r+rrr�test_spaces�s
�
��
�zMaxLinesTestCase.test_spacesc	Cs|j|jddgddd�|j|jdddgddd�|�t��t|jd	d
ddd�Wd�n1s3wY|�t��t|jd	d
ddd
�Wd�n1sRwY|j|jd	ddgdd
ddd�|j|jd	dgddd
dd�|j|jd|jgdd�dS)Nr.zHello...rNz...�r��placeholderr0z
how are...r�r\r|z [truncated]...)r?r�r�)r�r�r�z    Hello there,z  [truncated]...r�)r�r?r�r�r4a�........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................�r�)r!rr�r�rr+rrr�test_placeholdersN
�
��
��
��
��
�z!MaxLinesTestCase.test_placeholdercCs d}|j|dddgddd�dS)Nz1Good grief Python features are advancing quickly!r.z
Good griefzPython*****�z*****r�r5r6rrr�test_placeholder_backtrack2s
�z+MaxLinesTestCase.test_placeholder_backtrackN)r&r'r(rr7r�r�r�rrrrr��s r�c@�,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LongWordTestCasecCst�|_d|_dS)Nz]Did you say "supercalifragilisticexpialidocious?"
How *do* you spell that odd word, anyways?
)rr#rr+rrrr,?s
zLongWordTestCase.setUpcCsV|�|jdgd��|�|jdddg�|jddgd�d	d
�|�|jdgd��dS)
NrJ)zDid you say "supercalifragiliszticexpialidocious?" How *do*zyou spell that odd word,�anyways?r�z1Did you say "supercalifragilisticexpialidocious?"z*How *do* you spell that odd word, anyways?z----------hellor{)z
----------z               hz               e�               lr�z               oz               )r�r.)	�Did you say �"supercalifr�agilisticexpzialidocious?z
" How *do*z	you spellzthat oddzword,r�r�r+rrr�test_break_longFs
�
���
�z LongWordTestCase.test_break_longcCsRd|j_d|j_gd�}|j�|j�}|�||�t|jddd�}|�||�dS)NrrJ)zDid you sayz%"supercalifragilisticexpialidocious?"zHow *do* you spell that oddzword, anyways?)rrP)r#rPrrrr�rrrrrr�test_nobreak_longjsz"LongWordTestCase.test_nobreak_longcCs|j|jdgd�dd�dS)Nr.)r�r�r�r�rBr�r�r+rrr�test_max_lines_longzs

�z$LongWordTestCase.test_max_lines_longN)r&r'r(r,r�r�r�rrrrr�>s
$r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�LongWordWithHyphensTestCasecCst�|_d|_d|_dS)NzOWe used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate synthase.
zC1234567890-1234567890--this_is_a_very_long_option_indeed-good-bye"
)rr#�text1�text2r+rrrr,�s
z!LongWordWithHyphensTestCase.setUpcCsLddg}|�|jd|�gd�}|�|jd|�gd�}|�|jd|�dS)Nz(We used enyzme 2-succinyl-6-hydroxy-2,4-z&cyclohexadiene-1-carboxylate synthase.r�)
�We usedz	enyzme 2-z	succinyl-z
6-hydroxy-z2,4-Z
cyclohexadziene-1-Z
carboxylat�e�	synthase.r{�Z
1234567890z
-123456789z
0--this_isZ
_a_very_loZ
ng_option_zindeed-z	good-bye"�r!r�r��r�expectedrrr�test_break_long_words_on_hyphen�s�z;LongWordWithHyphensTestCase.test_break_long_words_on_hyphencCsTddg}|j|jd|dd�gd�}|j|jd|dd�gd�}|�|jd|�dS)	Nz2We used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadziene-1-carboxylate synthase.r�Fr�)r�z
enyzme 2-sz
uccinyl-6-z
hydroxy-2,z
4-cyclohexz
adiene-1-cZ
arboxylater�r{r�r�r�rrr�#test_break_long_words_not_on_hyphen�s�z?LongWordWithHyphensTestCase.test_break_long_words_not_on_hyphencCsTgd�}|j|jd|dd�gd�}|j|jd|dd�gd�}|�|jd|�dS)N�zWe used enyzme�52-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylater�r�FrO�r�Zenyzmer�r�r{r�r�r�rrr�'test_break_on_hyphen_but_not_long_words�szCLongWordWithHyphensTestCase.test_break_on_hyphen_but_not_long_wordscCsXgd�}|j|jd|ddd�gd�}|j|jd|ddd�gd�}|�|jd|�dS)Nr�r�F)rPr�r�r{r�r�r�rrr�*test_do_not_break_long_words_or_on_hyphens�s��zFLongWordWithHyphensTestCase.test_do_not_break_long_words_or_on_hyphensN)r&r'r(r,r�r�r�r�rrrrr��s	

r�c@r�)
�IndentTestCasescCs
d|_dS)NznThis paragraph will be filled, first without any indentation,
and then with some (including a hanging indent).)rr+rrrr,�s
zIndentTestCases.setUpcCs d}t|jd�}|�||�dS)NznThis paragraph will be filled, first
without any indentation, and then with
some (including a hanging indent).rH�rrrr�rrr�	test_fill�szIndentTestCases.test_fillcCsNgd�}t|jddd�}|�||�d�|�}t|jddd�}|�||�dS)N)z#     This paragraph will be filled,z'first without any indentation, and thenz'with some (including a hanging indent).rHr�r>r	)rrrrrr�rrr�test_initial_indent�s
z#IndentTestCases.test_initial_indentcCs&d}t|jdddd�}|�||�dS)Nz~  * This paragraph will be filled, first
    without any indentation, and then
    with some (including a hanging
    indent).rHz  * r|r�r�r�rrr�test_subsequent_indent�s
�z&IndentTestCases.test_subsequent_indentN)r&r'r(r,r�r�r�rrrrr��s
r�c@�DeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�DedentTestCasecCs	|�|t|��dSr�rrr6rrr�assertUnchangedszDedentTestCase.assertUnchangedcCs<d}|�|�d}|�|�d}|�|�d}|�|�dS)Nz,Hello there.
How are you?
Oh good, I'm glad.zHello there.

Boo!z Hello there.
  This is indented.zHello there.

  Boo!
)r�r6rrr�test_dedent_nomargins


z#DedentTestCase.test_dedent_nomargincC�Ld}d}|�|t|��d}d}|�|t|��d}d}|�|t|��dS)Nz'  Hello there.
  How are ya?
  Oh good.z!Hello there.
How are ya?
Oh good.z)  Hello there.

  How are ya?
  Oh good.
z#Hello there.

How are ya?
Oh good.
z+  Hello there.
  
  How are ya?
  Oh good.
r�rRrrr�test_dedent_even�zDedentTestCase.test_dedent_evencCr�)NzK        def foo():
            while 1:
                return foo
        z+def foo():
    while 1:
        return foo
z  Foo
    Bar

   Baz
zFoo
  Bar

 Baz
z  Foo
    Bar
 
   Baz
r�rRrrr�test_dedent_uneven%sz!DedentTestCase.test_dedent_unevencCr�)Nz     Foo
    Bar
z	 Foo
Bar
z     Foo

    Bar
z
 Foo

Bar
z     Foo
    
    Bar
r�rRrrr�test_dedent_declining=r�z$DedentTestCase.test_dedent_decliningcCs,d}d}|�|t|��|�|t|��dS)Nz  hello	there
  how are	you?zhello	there
how are	you?r�rRrrr�"test_dedent_preserve_internal_tabsNsz1DedentTestCase.test_dedent_preserve_internal_tabscCs�d}|�|�d}|�|�d}d}|�|t|��d}|�|t|��d}|�|t|��d}d}|�|t|��d	}d
}|�|t|��dS)Nz  hello there
	how are you?z!        hello there
	how are you?z	hello there
	how are you?zhello there
how are you?z  	hello there
  	how are you?z"  	  hello there
  	  how are you?z   	hello there
  	  how are you?zhello there
  how are you?z2  	hello there
   	how are you?
 	I'm fine, thanksz/ 	hello there
  	how are you?
	I'm fine, thanks)r�rrrRrrr� test_dedent_preserve_margin_tabsZs"

z/DedentTestCase.test_dedent_preserve_margin_tabsN)
r&r'r(r�r�r�r�r�r�r�rrrrr��sr�c@speZdZdZedZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�IndentTestCase)�Hi.
This is a test.
Testing.zHi.
This is a test.

Testing.z
Hi.
This is a test.
Testing.
)� Hi.
This is a test.
Testing.
z#
Hi.
This is a test.

Testing.

cCs"|jD]}|�t|d�|�qdS�Nr8��CASESrrr6rrr�test_indent_nomargin_default�s
�z+IndentTestCase.test_indent_nomargin_defaultcCs$|jD]}|�t|dd�|�qdSr�r�r6rrr�%test_indent_nomargin_explicit_default�s
�z4IndentTestCase.test_indent_nomargin_explicit_defaultcC�,dd�}|jD]}|�t|d|�|�qdS)NcS�dS�NTr��linerrr�<lambda>��z?IndentTestCase.test_indent_nomargin_all_lines.<locals>.<lambda>r8r��r�	predicaterrrr�test_indent_nomargin_all_lines�s
�z-IndentTestCase.test_indent_nomargin_all_linescCr�)NcSr�)NFrr�rrrr��r�z5IndentTestCase.test_indent_no_lines.<locals>.<lambda>r|r�r�rrr�test_indent_no_lines�s
�z#IndentTestCase.test_indent_no_linescC�&|jD]
}|�tt|d��|�qdS)Nr|��ROUNDTRIP_CASESrrrr6rrr�test_roundtrip_spaces��
�z$IndentTestCase.test_roundtrip_spacescCr�)Nz		r�r6rrr�test_roundtrip_tabs�r�z"IndentTestCase.test_roundtrip_tabscCr�)Nz 	  	 r�r6rrr�test_roundtrip_mixed�r�z#IndentTestCase.test_roundtrip_mixedcCs4d}d}t|j|�D]
\}}|�t||�|�q
dS�Nr�)�"  Hi.
  This is a test.
  Testing.z#  Hi.
  This is a test.

  Testing.z$
  Hi.
  This is a test.
  Testing.
�&  Hi.
  This is a test.
  Testing.
z)
  Hi.
  This is a test.

  Testing.

��zipr�rr�r�prefixr�rrrrr�test_indent_default�s
�z"IndentTestCase.test_indent_defaultcCs6d}d}t|j|�D]\}}|�t||d�|�q
dSr�r�r�rrr�test_indent_explicit_default�s
�z+IndentTestCase.test_indent_explicit_defaultcC�>d}d}dd�}t|j|�D]\}}|�t|||�|�qdS)Nr�)r�z%  Hi.
  This is a test.
  
  Testing.z&  
  Hi.
  This is a test.
  Testing.
r�z/  
  Hi.
  This is a test.
  
  Testing.
  
cSr�r�rr�rrrr��r�z6IndentTestCase.test_indent_all_lines.<locals>.<lambda>r��rr�r�r�rrrrr�test_indent_all_lines���z$IndentTestCase.test_indent_all_linescCr�)Nr�)r�zHi.
This is a test.
  
Testing.z   
Hi.
This is a test.
Testing.
r�z)  
Hi.
This is a test.
  
Testing.
  
cSs
|��Sr)�stripr�rrrr��s
z8IndentTestCase.test_indent_empty_lines.<locals>.<lambda>r�r�rrr�test_indent_empty_lines�rz&IndentTestCase.test_indent_empty_linesN)r&r'r(r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�xsr�c@r�)�ShortenTestCasecKrr)rrrrrr�
check_shortenr"zShortenTestCase.check_shortencCs>d}|�|dd�|�|t|�|�|�|t|�dd�dS)N�<Hello there, how are you this fine day? I'm glad to hear it!�zHello there, [...]rNz9Hello there, how are you this fine day? I'm glad to [...]�rr
r6rrrr7s�zShortenTestCase.test_simplecCsnd}|j|dddd�|j|dddd�|j|ddd	d�|j|t|�|dd�|j|t|�d
ddd�dS)Nrr^zHello there,$$z$$r�rzHello there, how$$zHello there, $$z $$rNz:Hello there, how are you this fine day? I'm glad to hear$$rr6rrrr�s
�z ShortenTestCase.test_placeholdercCs|�ddd�dS)Nr8r9�rr+rrrr<�z!ShortenTestCase.test_empty_stringcCsNd}|�|dd�|�|dd�|�ddd�|�dd	d
�|�ddd�dS)
Nz[
            This is a  paragraph that  already has
            line breaks and 	 tabs too.�>z>This is a paragraph that already has line breaks and tabs too.�=z:This is a paragraph that already has line breaks and [...]zhello      world!  r.zhello world!�zhello [...]r{r�r	r6rrrrDs��zShortenTestCase.test_whitespacecCsLtdddd�|�t��tdddd�Wd�dS1swYdS)NZxxxxxxxxxxxxxxxxxxxx�z(......))rr�z	(.......))rr�r�r+rrr�$test_width_too_small_for_placeholder.s"�z4ShortenTestCase.test_width_too_small_for_placeholdercCs|�ddd�dS)NZHelloo�r�r	r+rrr�-test_first_word_too_long_but_placeholder_fits3r
z=ShortenTestCase.test_first_word_too_long_but_placeholder_fitsN)
r&r'r(rr7r�r<rDrrrrrrr�s
r�__main__)Zunittest�textwraprrrrrrZTestCaserr)r�r�r�r�r�r�rr&�mainrrrr�<module>s$
 4_EH3z9�