+
    Bi+                     ~    ^ RI t ^ RIHtHt  ! R R] P                  ]4      t]R8X  d   ] P                  ! 4        R# R# )    N)TStringBaseCasefstringc                   h   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V tR# )TestTStringc                    RR pV P                  \        V4      R4       RpRVR-3 pV P                  \        V4      R4       R# )	Helloz/Template(strings=('Hello',), interpolations=())Pythonnamez^Template(strings=('Hello, ', ''), interpolations=(Interpolation('Python', 'name', None, ''),))Nr    Hello,  )assertEqualreprselftr
   s   &  (/usr/lib/python3.14/test/test_tstring.pytest_string_representation&TestTString.test_string_representation   sG    a"STdVaK	
    c                @   R pRVR-3 pV P                  VRVR3.4       V P                  \        V4      R4       R pRpRVR-VR-3 pV P                  VRVR3VR3.4       V P                  \        V4      R4       ^
p^pRWV,           R-3 pV P                  VRWV,           R3.4       V P                  \        V4      R4       R	 pRV! ^4      R
-3 pV P                  VRV! ^4      R
3.4       V P                  \        V4      R4        ! R R4      pV! R4      p	RV	P                  R-3 pV P                  VRV	P                  R3.4       V P                  \        V4      R4       RV	P	                  4       R-3 pV P                  VRV	P	                  4       R3.4       V P                  \        V4      R4       RRR^/p
RV
R,          R-V
R,          R-3 pV P                  VRV
R,          R3V
R,          R3.4       V P                  \        V4      R4       R# )r	   r
   Hello, Python	DeveloperfirstlastzPython Developerza + bzSum: 30c                     W ,          # Nr   )xs   &r   square5TestTString.test_interpolation_basics.<locals>.square+   s	    5Lr   z	square(5)z
Square: 25c                   ,   a  ] tR t^4t o R tR tRtV tR# )5TestTString.test_interpolation_basics.<locals>.Personc                    Wn         R # r   r
   )r   r
   s   &&r   __init__>TestTString.test_interpolation_basics.<locals>.Person.__init__5   s     	r   c                6    V P                   P                  4       # r   )r
   upperr   s   &r   r*   ;TestTString.test_interpolation_basics.<locals>.Person.upper8   s    yy((r   r&   N)__name__
__module____qualname____firstlineno__r'   r*   __static_attributes____classdictcell____classdict__s   @r   Personr$   4   s     !) )r   r5   Alicezperson.namezName: Alicezperson.upper()zName: ALICEBobagezdata['name']zdata['age']zName: Bob, Age: 30Nr   )r    r   )zSum: r   )zSquare: r   )Name: r   )r:   z, Age: r   )assertTStringEqualr   r   r
   r*   )r   r
   r   r   r   abr!   r5   persondatas   &          r   test_interpolation_basics%TestTString.test_interpolation_basics   sD   dV?dF^4DE_5 ugtf}w/$@	
 	%78 AE7O=AE73C2DEY/	"vayk"6!9k":!;	
 	\2	) 	) "V[[M"~m <=	
 	]3 &V\\^$%~1A BC	
 	]3 ub)7T&\N$u+7(6lN+d5k=-IJ	
 	%9:r   c                    R pRVRR-3 pV P                  VRVRRR3.4       V P                  \        V4      R4       R# )gn!	@value.2fNzPi: 3.14)zPi: r   r;   r   r   r   rC   r   s   &  r   test_format_specifiers"TestTString.test_format_specifiersR   sN    5++|ugtU;<	
 	Z0r   c                J   \        4       pRVR-3 pV P                  VRVRR3.4       V P                  \        V4      R \	        V4       24       RVR-
3 pV P                  VRVRR3.4       V P                  \        V4      R\        V4       24       RpRVR-3 pV P                  VRVRR3.4       V P                  \        V4      R\        V4       24       ^pV P                  \        4      ;_uu_ 4        \        R	4       R
R
R
4       R
#   + '       g   i     R
# ; i)Object: objsData: ru   CaféASCII: textr<   z
t'{num!z}'N)rJ   r   )rM   r   )rO   r   )
objectr;   r   r   strr   asciiassertRaisesSyntaxErroreval)r   rK   r   rP   nums   &    r   test_conversionsTestTString.test_conversions[   s   hsg#3sE36G5HIxCz%:; SG>S%4E3FGvd3i[%9: dX?dFC5H4IJwuT{m%<= {++ ,+++s   ;DD"	c                   ^*pR	VR-
3 pV P                  VR	VRR3.4       V P                  \        V4      R4       R	VRR-3 pV P                  VR	VRRR3.4       V P                  \        V4      R4       R	VR-3 pV P                  VR	VRR3.4       R
VR-
3 pV P                  VR
VRR3.4       V P                  \        V4      R4       R# )*   rC   rN   zValue: value=42rD   NzValue: value=42.00rL   zValue: value = 42)zValue: value=r   )zValue: value = r   rE   rF   s   &  r   test_debug_specifier TestTString.test_debug_specifierr   s   eX$w'<&=	
 	%67 #e\S\"$we'D&E	
 	%9: !eZ $w'<&=	

 !eZ &%#)>(?	
 	%89r   c                    R pRVR-3 pV P                  VRVR3.4       V P                  \        V4      R4       RVR-3 pV P                  VRVR3.4       R# )zC:\UserspathzC:\Users\DocumentsN)r   z
\DocumentsrE   )r   r_   r   s   &  r   test_raw_tstringsTestTString.test_raw_tstrings   sj     v #6$8HI%:; !v #6$8HIr   c                6   R	R
 pRR
 pW,           pV P                  VRR
4       V P                  \        V4      R4       RR
 pRpV P                  \        V4      ;_uu_ 4        VR,            RRR4       RpR	R
 pRVR-3 pW,           pV P                  VRVR3.4       V P                  \        V4      R4       RpV P                  \        V4      ;_uu_ 4        R RVR-3 ,            RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   Hello, worldz]can only concatenate string.templatelib.Template \(not "str"\) to string.templatelib.Templatez, worldNr	   r
   r   zEcan only concatenate str \(not "string.templatelib.Template"\) to str)r   r   )worldrc   r   r   r   r   )r;   r   r   assertRaisesRegex	TypeError)r   t1t2combinedexpected_msgr
   s   &     r   test_template_concatenation'TestTString.test_template_concatenation   s    7*;R@*N; =##I|<<N = vY7/T6N;KL*O<=##I|<<	4&	! =< =< =<<s   #
C4D4D	D	c                0   R pRVR-3 pRVR-3 pVP                   ^ ,          pV P                  VP                  R4       V P                  VP                  P                  R4       V P                  VP                  P                   ^ ,          P                  V4       V P                  VP                  P                   ^ ,          P                  R4       V P                  VP                  P                   ^ ,          P
                  R4       V P                  VP                  P                   ^ ,          P                  R4       V P                  VP                  R4       V P                  VP
                  R4       V P                  VP                  R4       R# )r	   r   r
   innerNrf   )z
Language: r   )interpolationsr   stringsrC   
expression
conversionformat_spec)r   r
   rp   r   t_interps   &    r   test_nested_templates!TestTString.test_nested_templates   s3   4&	  ##A&$67//:66q9??F66q9DDfM66q9DDdK66q9EErJ,,g6,,d3--r2r   c           
        R FY  w  rV P                  V4      ;_uu_ 4        V P                  \        V4      ;_uu_ 4        \        V4       RRR4       RRR4       K[  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)t'N))rz   zunterminated t-string literal)zt'''+unterminated triple-quoted t-string literal)zt''''r{   )zt'{z'{' was never closed)zt'{'t-string: expecting '}')zt'{a'r|   )zt'}'z#t-string: single '}' is not allowed)zt'{}'z.t-string: valid expression required before '}')zt'{=x}'z.t-string: valid expression required before '=')zt'{!x}'z.t-string: valid expression required before '!')zt'{:x}'z.t-string: valid expression required before ':')zt'{x;y}'z/t-string: expecting '=', or '!', or ':', or '}')zt'{x=y}'z't-string: expecting '!', or ':', or '}')z	t'{x!s!}'zt-string: expecting ':' or '}')zt'{x!s:'z(t-string: expecting '}', or format specs)zt'{x!}'&t-string: missing conversion character)zt'{x=!}'r}   )zt'{x!z}'zEt-string: invalid conversion character 'z': expected 's', 'r', or 'a')zt'{lambda:1}'z@t-string: lambda expressions are not allowed without parentheses)z
t'{x:{;}}'z0t-string: expecting a valid expression after '{')z	t'{1:d
}'z7t-string: newlines are not allowed in format specifiers)subTestrg   rU   rV   )r   caseerrs   &  r   test_syntax_errorsTestTString.test_syntax_errors   sZ    
ID2 d##T%;%;K%M%MT
 &N##3
2 &N%M###s#   A5 A"A5"A2-A55Bc                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)zt'Hello, {name}'N)rT   	NameErrorrV   r+   s   &r   test_runtime_errorsTestTString.test_runtime_errors   s+    y))#$ *)))s	   4A	c           
        RR pV P                  VRR4       V P                  \        V4      R 4       RpR	VR-3 pV P                  VR	VR3.4       V P                  \        V4      R4       RpRpR
 FW  pV P                  V4      ;_uu_ 4        V P	                  \
        V4      ;_uu_ 4        \        V4       RRR4       RRR4       KY  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)rc   r	   r
   r   r   z:cannot mix t-string literals with string or bytes literalsNre   r   r   )z&t'{what}-string literal' 'str literal'z+t'{what}-string literal' u'unicode literal'z,t'{what}-string literal' f'f-string literal'z.t'{what}-string literal' r'raw string literal'z1t'{what}-string literal' rf'raw f-string literal'z)t'{what}-string literal' b'bytes literal'z.t'{what}-string literal' br'raw bytes literal'z&'str literal' t'{what}-string literal'z+u'unicode literal' t'{what}-string literal'z,f'f-string literal' t'{what}-string literal'z.r'raw string literal' t'{what}-string literal'z1rf'raw f-string literal' t'{what}-string literal'z)b'bytes literal' t'{what}-string literal'z.br'raw bytes literal' t'{what}-string literal')r;   r   r   r~   rg   rU   rV   )r   r   r
   whatrl   r   s   &     r   test_literal_concatenation&TestTString.test_literal_concatenation   s    #4b9^4  $ ?dF^4DE_5 S
D  d##++KFFJ G $#!
" GF $##s$   C#.C:C#C C##C4c                    RR pV P                  VRR4       V P                  \        V4      R 4       RpRVR-3 pV P                  VRVR3.4       V P                  \        V4      R4       R# )&
        Hello,
        world
        r	   r
   z'
        Hello,
        Python
        N)r   r   )z
        Hello,
        z	
        rE   r   s   &  r   test_triple_quotedTestTString.test_triple_quoted  s     	=r	
 	%PQ 	 	;tVn=M	
 	%QRr   r   N)r-   r.   r/   r0   r   r@   rG   rX   r\   r`   rm   rw   r   r   r   r   r1   r2   r3   s   @r   r   r      sK     

=;~1.::J":3":%
!FS Sr   r   __main__)unittesttest.test_string._supportr   r   TestCaser   r-   mainr   r   r   <module>r      s<     >ZS(##_ ZSx zMMO r   