+
    Bi7                     @   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt RtRt	 ! R R]P                  4      t]! ]RR4      '       g;   ]! ]4       F.  t]P                  R	4      '       g   K  ]R
8w  g   K%  ]! ]]4       K0  	  ]R8X  d   ]P$                  ! 4        R# R# )    N)cpython_only)import_helperu  x|x|
foo bar|foo|bar|
 foo bar|foo|bar|
 foo bar |foo|bar|
foo   bar    bla     fasel|foo|bar|bla|fasel|
x y  z              xxxx|x|y|z|xxxx|
\x bar|\|x|bar|
\ x bar|\|x|bar|
\ bar|\|bar|
foo \x bar|foo|\|x|bar|
foo \ x bar|foo|\|x|bar|
foo \ bar|foo|\|bar|
foo "bar" bla|foo|"bar"|bla|
"foo" "bar" "bla"|"foo"|"bar"|"bla"|
"foo" bar "bla"|"foo"|bar|"bla"|
"foo" bar bla|"foo"|bar|bla|
foo 'bar' bla|foo|'bar'|bla|
'foo' 'bar' 'bla'|'foo'|'bar'|'bla'|
'foo' bar 'bla'|'foo'|bar|'bla'|
'foo' bar bla|'foo'|bar|bla|
blurb foo"bar"bar"fasel" baz|blurb|foo"bar"bar"fasel"|baz|
blurb foo'bar'bar'fasel' baz|blurb|foo'bar'bar'fasel'|baz|
""|""|
''|''|
foo "" bar|foo|""|bar|
foo '' bar|foo|''|bar|
foo "" "" "" bar|foo|""|""|""|bar|
foo '' '' '' bar|foo|''|''|''|bar|
\""|\|""|
"\"|"\"|
"foo\ bar"|"foo\ bar"|
"foo\\ bar"|"foo\\ bar"|
"foo\\ bar\"|"foo\\ bar\"|
"foo\\" bar\""|"foo\\"|bar|\|""|
"foo\\ bar\" dfadf"|"foo\\ bar\"|dfadf"|
"foo\\\ bar\" dfadf"|"foo\\\ bar\"|dfadf"|
"foo\\\x bar\" dfadf"|"foo\\\x bar\"|dfadf"|
"foo\x bar\" dfadf"|"foo\x bar\"|dfadf"|
\''|\|''|
'foo\ bar'|'foo\ bar'|
'foo\\ bar'|'foo\\ bar'|
"foo\\\x bar\" df'a\ 'df'|"foo\\\x bar\"|df'a|\|'df'|
\"foo"|\|"foo"|
\"foo"\x|\|"foo"|\|x|
"foo\x"|"foo\x"|
"foo\ "|"foo\ "|
foo\ xx|foo|\|xx|
foo\ x\x|foo|\|x|\|x|
foo\ x\x\""|foo|\|x|\|x|\|""|
"foo\ x\x"|"foo\ x\x"|
"foo\ x\x\\"|"foo\ x\x\\"|
"foo\ x\x\\""foobar"|"foo\ x\x\\"|"foobar"|
"foo\ x\x\\"\''"foobar"|"foo\ x\x\\"|\|''|"foobar"|
"foo\ x\x\\"\'"fo'obar"|"foo\ x\x\\"|\|'"fo'|obar"|
"foo\ x\x\\"\'"fo'obar" 'don'\''t'|"foo\ x\x\\"|\|'"fo'|obar"|'don'|\|''|t'|
'foo\ bar'|'foo\ bar'|
'foo\\ bar'|'foo\\ bar'|
foo\ bar|foo|\|bar|
foo#bar\nbaz|foobaz|
:-) ;-)|:|-|)|;|-|)|
áéíóú|á|é|í|ó|ú|
u1  x|x|
foo bar|foo|bar|
 foo bar|foo|bar|
 foo bar |foo|bar|
foo   bar    bla     fasel|foo|bar|bla|fasel|
x y  z              xxxx|x|y|z|xxxx|
\x bar|x|bar|
\ x bar| x|bar|
\ bar| bar|
foo \x bar|foo|x|bar|
foo \ x bar|foo| x|bar|
foo \ bar|foo| bar|
foo "bar" bla|foo|bar|bla|
"foo" "bar" "bla"|foo|bar|bla|
"foo" bar "bla"|foo|bar|bla|
"foo" bar bla|foo|bar|bla|
foo 'bar' bla|foo|bar|bla|
'foo' 'bar' 'bla'|foo|bar|bla|
'foo' bar 'bla'|foo|bar|bla|
'foo' bar bla|foo|bar|bla|
blurb foo"bar"bar"fasel" baz|blurb|foobarbarfasel|baz|
blurb foo'bar'bar'fasel' baz|blurb|foobarbarfasel|baz|
""||
''||
foo "" bar|foo||bar|
foo '' bar|foo||bar|
foo "" "" "" bar|foo||||bar|
foo '' '' '' bar|foo||||bar|
\"|"|
"\""|"|
"foo\ bar"|foo\ bar|
"foo\\ bar"|foo\ bar|
"foo\\ bar\""|foo\ bar"|
"foo\\" bar\"|foo\|bar"|
"foo\\ bar\" dfadf"|foo\ bar" dfadf|
"foo\\\ bar\" dfadf"|foo\\ bar" dfadf|
"foo\\\x bar\" dfadf"|foo\\x bar" dfadf|
"foo\x bar\" dfadf"|foo\x bar" dfadf|
\'|'|
'foo\ bar'|foo\ bar|
'foo\\ bar'|foo\\ bar|
"foo\\\x bar\" df'a\ 'df"|foo\\x bar" df'a\ 'df|
\"foo|"foo|
\"foo\x|"foox|
"foo\x"|foo\x|
"foo\ "|foo\ |
foo\ xx|foo xx|
foo\ x\x|foo xx|
foo\ x\x\"|foo xx"|
"foo\ x\x"|foo\ x\x|
"foo\ x\x\\"|foo\ x\x\|
"foo\ x\x\\""foobar"|foo\ x\x\foobar|
"foo\ x\x\\"\'"foobar"|foo\ x\x\'foobar|
"foo\ x\x\\"\'"fo'obar"|foo\ x\x\'fo'obar|
"foo\ x\x\\"\'"fo'obar" 'don'\''t'|foo\ x\x\'fo'obar|don't|
"foo\ x\x\\"\'"fo'obar" 'don'\''t' \\|foo\ x\x\'fo'obar|don't|\|
'foo\ bar'|foo\ bar|
'foo\\ bar'|foo\\ bar|
foo\ bar|foo bar|
foo#bar\nbaz|foo|baz|
:-) ;-)|:-)|;-)|
áéíóú|áéíóú|
c                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR t]R 4       tRtV tR# )	ShlexTestc                   \         P                  4        Uu. uF  pVP                  R 4      RR NK  	  upV n         \        P                  4        Uu. uF  pVP                  R 4      RR NK  	  upV n        V P                    F  pV^ ,          P	                  RR4      V^ &   K!  	  V P                   F  pV^ ,          P	                  RR4      V^ &   K!  	  R# u upi u upi )|Nz\n
)data
splitlinessplit
posix_datareplace)selfxitems   &  &/usr/lib/python3.14/test/test_shlex.pysetUpShlexTest.setUp   s    "oo/1/ WWS\#2&/1	 %/$9$9$;=$;q 773<,$;=IID1gooeT2DG OOD1gooeT2DG $1=s   CCc                   \        \        V4      4       Fm  p\        P                  ! W,          ^ ,          VR7      pV P	                  WAV,          R,          W,          ^ ,          : RV: RW,          R,          : 24       Ko  	  R# )r   comments   NN:  != N)rangelenshlexr   assertEqual)r   r   r   ils   &&&  r   	splitTestShlexTest.splitTest   s]    s4y!ADGAJ:AQQ"gajj!TWR[:; "    c                    . p\         P                   ! \        P                  ! V4      4      pVP                  4       pV'       d$   VP	                  V4       VP                  4       pK+  V# N)r   ioStringIO	get_tokenappend)r   sretlextoks   &&   r   oldSplitShlexTest.oldSplit   sF    kk"++a.)mmoJJsO--/C
r%   c                    V P                  \        4      ;_uu_ 4        \        P                  ! R 4       R R R 4       R #   + '       g   i     R # ; ir'   )assertRaises
ValueErrorr   r   r   s   &r   testSplitNoneShlexTest.testSplitNone   s.    z**KK +***s	   ?A	c                @    V P                  V P                  RR7       R# )z%Test data splitting with posix parserTr   N)r#   r   r5   s   &r   testSplitPosixShlexTest.testSplitPosix   s    t6r%   c                l   \        \        V P                  4      4       F  pV P                  V P                  V,          ^ ,          4      pV P	                  W P                  V,          R,          V P                  V,          ^ ,          : RV: RV P                  V,          R,          : 24       K  	  R# )zTest compatibility interfacer   r   r   N)r   r   r   r0   r    )r   r!   r"   s   &  r   
testCompatShlexTest.testCompat   sy    s499~&Adiil1o.AQ		!R 0"iil1ooq$))A,r2BDE 'r%   c                   R F  pRV,          RV,          .pRRVRR.p\         P                  ! VR4       FI  w  rE\        P                  ! VRR7      pWVn        \	        V4      pV P                  W7RV: R	V: R
24       KK  	  K  	  R# )z)Test handling of syntax splitting of &, |echo hi %s echo byeecho hi%secho byeechohibyeTpunctuation_charsWhile splitting '' [ws=]N)
&&&z|&;&;;&||r   z&|z;|z;;|FT	itertoolsproductr   whitespace_splitlistr    r   	delimitersrcrefsswsr,   results   &       r   testSyntaxSplitAmpersandAndPipe)ShlexTest.testSyntaxSplitAmpersandAndPipe   s    
8I(94&24C4FE:C#++C?KKd;%'"a  fCEr!JL	 @8r%   c                "   R F  pRV,          RV,          RV,          .pRRVRR.p\         P                  ! VR4       FI  w  rE\        P                  ! VRR7      pWVn        \	        V4      pV P                  W7R	V: R
V: R24       KK  	  K  	  R# )z&Test handling of syntax splitting of ;r?   zecho hi%s echo byer@   rA   rB   rC   TrD   rF   rG   rH   N);z;;rK   rL   rN   rO   rT   s   &       r   testSyntaxSplitSemicolon"ShlexTest.testSyntaxSplitSemicolon   s     2I(94')3&24C 4FE:C#++C?KKd;%'"a  fCEr!JL	 @ 2r%   c                   R F  pRV,          RV,          RV,          .pRRVR.p\         P                  ! VR4       FC  w  rE\        P                  ! VRR7      p\        V4      pV P	                  W7R	V: R
V: R24       KE  	  K  	  R# )z&Test handling of syntax splitting of >zecho hi %s outzecho hi%s outzecho hi%soutrA   rB   outTrD   rF   rG   rH   N)<r   rN   )rP   rQ   r   rS   r    rT   s   &       r   testSyntaxSplitRedirect!ShlexTest.testSyntaxSplitRedirect   s     $I#i/"Y.!I-/C 4E2C#++C?KKd;a  fCEr!JL @ $r%   c           
         RR.p. R	Op\         P                  ! VR
4       FI  w  r4\        P                  ! VRR7      pWEn        \	        V4      pV P                  W&RV: RV: R24       KK  	  R# )z'Test handling of syntax splitting of ()z( echo hi )z	(echo hi)TrD   rF   rG   rH   N)(rA   rB   )rN   rO   )r   rV   rW   rX   rY   r,   rZ   s   &      r   testSyntaxSplitParenShlexTest.testSyntaxSplitParen   si     &''];FBB$7A!#!WFS&?A2FH	 <r%   c                   Rp. ROp\         P                   ! VRR7      p\        V4      pV P                  W$RV,          4       . R	Op\         P                   ! VRR7      pRVn        \        V4      pV P                  W$RV,          4       R# )
z3Test handling of syntax splitting with custom charsz~/a&&b-c --color=auto||d *.py?r   rD   zWhile splitting '%s' [ws=False]TzWhile splitting '%s' [ws=True]N)z~/arJ   rJ   zb-c--color=autorM   d*.py?)z~/a&&b-crl   rM   rm   rn   )r   rS   r    rR   )r   rX   rW   r,   rZ   s   &    r   testSyntaxSplitCustomShlexTest.testSyntaxSplitCustom   sw    -JKKc2a&G"&LM>KKc2!a&F&KLr%   c                "   R. RO33 F  w  r\         P                   ! VRR7      p. p VP                  4       pWSP                  8X  d   M1V^ ,          VP                  9   d   RpMRpVP	                  WV34       KS  V P                  WB4       K  	  R# )z2Test that tokens are split with types as expected.za && b || cacTrD   N))rr   rr   )rI   rs   )brr   )rM   rs   )rs   rr   )r   r*   eofrE   r+   r    )r   sourceexpectedr,   observedttts   &      r   testTokenTypesShlexTest.testTokenTypes   s     "/";!<! F
 Fd;AHKKM:Q41...BB(X0!! r%   c                    \         P                   ! RRR7      pV P                  RVP                  4       V P                  \	        V4      . RO4       R# )z:Test that any punctuation chars are removed from wordcharsa_b__c_rD   N)rr   r   rt   __rs   )r   assertNotIn	wordcharsr    rS   r   r,   s   & r   testPunctuationInWordChars$ShlexTest.testPunctuationInWordChars  s;    KKC8akk*a"<=r%   c                    \         P                   ! RRR7      pV P                  \        V4      . RO4       \         P                   ! RRR7      pRVn        V P                  \        V4      . RO4       R# )z9Test that with whitespace_split, behaviour is as expectedza  && b  ||  crJ   rD   TN)rr   rI   rt   r   r   rs   )rr   rI   rt   rM   rs   )r   r    rS   rR   r   s   & r   "testPunctuationWithWhitespaceSplit,ShlexTest.testPunctuationWithWhitespaceSplit  sZ    KK(C@ 	a"ABKK(C@! 	a"=>r%   c                    \         P                   ! RRRR7      pV P                  \        V4      . RO4       \         P                   ! RRRR7      pV P                  \        V4      . RO4       R# )z@Test that punctuation_chars and posix behave correctly together.zf >"abc"TposixrE   z
f >\"abc\"N)f>abc)r   r   z"abc")r   r    rS   r   s   & r   testPunctuationWithPosix"ShlexTest.testPunctuationWithPosix&  sR     KK
$$Ga"34KKddKa"56r%   c                    . ROpR F8  p\         P                   ! RRVR7      p\        V4      pV P                  WA4       K:  	  . ROp\         P                   ! RRR7      pV P                  \        V4      V4       R# )	z8Test that parsing of empty strings is correctly handled.Tz'')abcr   rD   N) rh   r   rN   )''rh   r   )r   rS   r    )r   rw   punctr,   slists   &    r   testEmptyStringHandling!ShlexTest.testEmptyStringHandling.  sg     $"EHDEJAGEU- # &KKD9a(+r%   c                    RpR.p\         P                   ! VRR7      pRVn        V P                  \        V4      V4       . ROp\         P                   ! VRR7      pV P                  \        V4      V4       R# )z;Test punctuation_chars and whitespace_split handle unicode.u   ℙƴ☂ℌøἤTrD   N)u   ℙu   ƴu   ☂u   ℌ   øu   ἤ)r   rR   r    rS   )r   rX   rW   r,   s   &   r   testUnicodeHandlingShlexTest.testUnicodeHandling:  sd    356KKd3!a#&JKKd3a#&r%   c                ,   \         P                  \         P                  ,           R ,           pRpRV,           pV P                  \        P
                  ! R4      R4       V P                  \        P
                  ! R4      R4       V P                  \        P
                  ! V4      V4       V P                  \        P
                  ! R4      R4       V F7  pV P                  \        P
                  ! RV,          4      R	V,          4       K9  	  V F7  pV P                  \        P
                  ! R
V,          4      RV,          4       K9  	  V P                  \        \        P
                  ^*4       V P                  \        \        P
                  R4       R# )z
@%_-+=:,./u   éàßz"`$\!r   r   Nztest file namez'test file name'z
test%snamez'test%sname'ztest%s'name'z'test%s'"'"'name'"'"''s   abc)stringascii_lettersdigitsr    r   quoter3   	TypeError)r   safeunquotedunicode_sampleunsafeus   &    r   	testQuoteShlexTest.testQuoteG  s   ++fmm;lJ'N*R$/T*D1\2LA%568JKAU[[)9:+a/1  AU[[!);<9A=?  	)U[["5)U[[&9r%   c                    R R.R3RR.R3. ROR3RR.R	33 FO  w  rV P                  VR
7      ;_uu_ 4        \        P                  ! V4      pV P                  W24       RRR4       KQ  	  R#   + '       g   i     Kf  ; i)za rt   z'a ' brr   z bza ' b'za ' ' bz"azb"z	'"a' 'b"'commandN)rr    rt   )subTestr   joinr    )r   split_commandr   joineds   &   r   testJoinShlexTest.testJoinY  s    C[(#4[(#i(D\?+	'
"M g..M2  1 /.'
 /..s   (A,,A=c                <   V P                   V P                  ,           pV Fd  vr#V P                  VR 7      ;_uu_ 4        \        P                  ! V4      p\        P
                  ! V4      pV P                  W54       RRR4       Kf  	  R#   + '       g   i     K{  ; i)r   N)r   r   r   r   r   r   r    )r   all_datar   r   r   resplits   &     r   testJoinRoundtripShlexTest.testJoinRoundtripd  sn    99t.'/#Gg..M2++f-  8 /. (0...s   >B

Bc                    R p\         P                   ! VR7      pV P                  VP                  V4       V P                  \        4      ;_uu_ 4        RVn        RRR4       R#   + '       g   i     R# ; i)z/|$%^rD   FN)r   r    rE   r3   AttributeError)r   rE   shlex_instances   &  r   testPunctuationCharsReadOnly&ShlexTest.testPunctuationCharsReadOnlyl  sV    #7HI99;LM~../4N, /...s   A%%A6	c                8    \         P                  ! R 0 Rm4       R# )r   N>   osrecollections)r   ensure_lazy_importsr5   s   &r   test_lazy_importsShlexTest.test_lazy_importss  s    ))'3NOr%   )r   r   N)__name__
__module____qualname____firstlineno__r   r#   r0   r6   r9   r<   r[   r_   rd   ri   ro   r{   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     3;7EL"L LHM1(>
?7
,':$	295 P Pr%   r   r   testr<   __main__)r(   rP   r   r   unittesttest.supportr   r   r   r   TestCaser   getattrdirmethname
startswithdelattrr   main r%   r   <module>r      s    	     % &
=~>
@jP!! jP\ ugt$$	Nv&&8|+CIx( # zMMO r%   