python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_unicodedata.cpython-312.opt-1.pyc

Αe
D(dZddlZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZmZGddejZGddejZGd	d
eZGddeZGd
dejZedk(rej(yy)z Tests for the unicodedata module.

    Written by Marc-Andre Lemburg (mal@lemburg.com).

    (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

N)
HTTPException)open_urlresourcerequires_resource
script_helpercpython_onlycheck_disallow_instantiationc,eZdZdZeddZy)UnicodeMethodsTest(e708c31c0d51f758adf475cb7201cf80917362becpuctj}ttjdzD]}t|}d|j
d|jd|jd|jd|jd|jd|jd|jd|jd|dzj
d|dzjd|dzjd|dzjd|dzjd|dzjd|dzjd|dzjd|dzj|j|j!|j#|dzj|dzj!|dzj#|dzj#g}|j%dj'|j)dd	|j+}|j-||j.y)
N01abc123z 	ABCutf-8
surrogatepass)hashlibsha1rangesys
maxunicodechrisalnumisalpha	isdecimalisdigitislower	isnumericisspaceistitleisupperloweruppertitleupdatejoinencode	hexdigestassertEqualexpectedchecksum)selfhichardataresults      I/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_unicodedata.pytest_method_checksumz'UnicodeMethodsTest.test_method_checksums&LLNs~~)*%	EAq6DT\\^$T\\^$T^^%&T\\^$T\\^$T^^%&T\\^$T\\^$T\\^$dUl++-.dUl++-.dUl--/0dUl++-.dUl++-.dUl--/0dUl++-.dUl++-.dUl++-.





$$&$$&$$&$$&A"DF
HHRWWT]))'?CDK%	EL!6!67N)__name__
__module____qualname__r-rr5r6r4r
r
s"Bu)8)8r6r
ceZdZeZy)UnicodeDatabaseTestN)r7r8r9unicodedatadbr:r6r4r<r<Cs	Br6r<ceZdZdZeddZeddZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZy)UnicodeFunctionsTest(26ff0d31c14194b4606a5b3a81ac36df3a14e331rcg}tj}ttjdzD]q}t|}t
|jj|ddt
|jj|ddt
|jj|dd|jj||jj||jj|t|jj|t|jj!|t#j$||jj'|dg
}|j)dj+|j-dt|j/}|j1||j2y)Nrz.12grascii)rrrrrrformatr>digitnumericdecimalcategory
bidirectional
decompositionstrmirrored	combiningr=east_asian_widthnamer(r)r*r+r,r-)r.r2r/r0r1r3s      r4test_function_checksumz+UnicodeFunctionsTest.test_function_checksumLsTLLNs~~)*	4Aq6Dtww}}T2.7twwtR0&9twwtR0&9  &%%d+%%d+DGG$$T*+DGG%%d+,,,T2T2&D
HHRWWT]))'23	4 !6!67r6cttjdzD]W}t|}|jj|dx}s-|j
|jj||Yy)Nr)rrrrr>rPr,lookup)r.r0r1looked_names    r4test_name_inverse_lookupz-UnicodeFunctionsTest.test_name_inverse_lookupdsas~~)*	DAq6D"ggll466{6  !<dC	Dr6c|j|jjddd|j|jjdd|j|jjddd|j|jjdd|j|jjddd|j|jjdd|jt|jj|jt|jjd	|jt
|jjd
yNA9	⅛⑨𠀀u𝟽xxx)r,r>rFassertRaises	TypeError
ValueErrorr.s r4
test_digitzUnicodeFunctionsTest.test_digitkssD148s+Q/x6=x0!4|T:DA|4a8)TWW]]3)TWW]]D9*dggmmS9r6cb|j|jjddd|j|jjdd|j|jjdd|j|jjdd|j|jjdd	|j|jjd
dd|j|jjdd|jt|jj|jt|jjd
|jt
|jjdy)NrXrYrZr[g?r\g"@u꘧g@r]𐄪i(#r_r`)r,r>rGrarbrcrds r4test_numericz!UnicodeFunctionsTest.test_numericwsT2D9-q12E:2C82C8t<dC6=)TWW__5)TWW__d;*dggoos;r6c|j|jjddd|j|jjdd|j|jjddd|j|jjddd|j|jjddd|j|jjdd|jt|jj|jt|jjd	|jt
|jjd
yrW)r,r>rHrarbrcrds r4test_decimalz!UnicodeFunctionsTest.test_decimalsT2D9-q148$?48$?t<dC6:)TWW__5)TWW__d;*dggoos;r6c\|j|jjdd|j|jjdd|j|jjdd|j|jjdd|j|jjd	d
|jt|jj|jt|jjdy)N￾CnaLlrXLur]LorgNor_)r,r>rIrarbrds r4
test_categoryz"UnicodeFunctionsTest.test_categorys))(3T:))#.5))#.5)),7>)),7>)TWW%5%56)TWW%5%5t<r6c|j|jjdd|j|jjdd|j|jjdd|j|jjdd|jt|jj|jt|jjdy)	Nrlr WSrXLr]r_)r,r>rJrarbrds r4test_bidirectionalz'UnicodeFunctionsTest.test_bidirectionals..x8"=..s3T:..s3S9..|<cB)TWW%:%:;)TWW%:%:DAr6cZ|j|jjdd|j|jjdd|jt|jj|jt|jjdy)Nrlr¼z<fraction> 0031 2044 0034r_)r,r>rKrarbrds r4test_decompositionz'UnicodeFunctionsTest.test_decompositionsw..x8<..x8:UV)TWW%:%:;)TWW%:%:DAr6c|j|jjdd|j|jjdd|j|jjdd|j|jjdd|jt|jj|jt|jjdy)Nrlrrnu∁rr]r_)r,r>rMrarbrds r4
test_mirroredz"UnicodeFunctionsTest.test_mirroreds))(3Q7))#.2))(3Q7)),7;)TWW%5%56)TWW%5%5t<r6c|j|jjdd|j|jjdd|j|jjdd|j|jjdd|jt|jj|jt|jjdy)Nrlrrnu⃡r]r_)r,r>rNrarbrds r4test_combiningz#UnicodeFunctionsTest.test_combinings**84a8**3/3**84c:**<8!<)TWW%6%67)TWW%6%6=r6cnd}|D].}|j|jjd||0y)N)uେ̀ାuᄀ̀ᅡuLi̍t-sṳ́u.मार्क ज़ुकेरबर्गu'किर्गिज़स्तानNFCr,r>	normalize)r.composedtexts   r4	test_pr29zUnicodeFunctionsTest.test_pr29s=8	CDTWW..ud;TB	Cr6cdd}d}|j|jjd||y)Nu?C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸Çu>C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸Çrr)r.rnbs   r4test_issue10254z$UnicodeFunctionsTest.test_issue10254s-'$**5!4a8r6c$d}d}d}d}d}d}|j|jjd|||j|jjd|||j|jjd||y)Nu	ᄀᅶᆨu	기ᆧu기ᆧu	기ᇃu기ᇃrr)r.u1176_str_au1176_str_bu11a7_str_au11a7_str_bu11c3_str_au11c3_str_bs       r4test_issue29456z$UnicodeFunctionsTest.test_issue29456s***$*$**5+>L**5+>L**5+>Lr6cH|jj}|jt|d|jt|t	|jt|d|jt|d|j|dd|j|dd|j|dd	|j|d
d|j|dd
|j|dd|j|dd	y)NarraNruNau좔WuヲHu?Fu‐rXr])r>rOrarb	bytearrayr,)r.eaws  r4test_east_asian_widthz*UnicodeFunctionsTest.test_east_asian_widthsgg&&)S$/)S)+6)S"-)S$/Vc*Vd+X,X,X,X,\*C0r6c|jj}dD]F}|j||d|j|jj	|ddHdD]F}|j||d|j|jj	|ddHdD]F}|j||d|j|jj	|ddHy)Nu԰໏჆⃼꫊𐞽𑗲ru﩮﫚𪛠𯨠𱍋𿿽ru󰀀󿿮􀀀􏿰rX)r>rOr,assertIsrP)r.rr1s   r4 test_east_asian_width_unassignedz5UnicodeFunctionsTest.test_east_asian_width_unassignedsgg&&H	:DSY,MM$'',,tT2D9	:
K	:DSY,MM$'',,tT2D9	:
K	:DSY,MM$'',,tT2D9	:r6c|j|jjjdd|j|jjddy)Nu⌚rr)r,r>	ucd_3_2_0rOrds r4!test_east_asian_width_9_0_changesz6UnicodeFunctionsTest.test_east_asian_width_9_0_changessF**;;HEsK11(;SAr6N)r7r8r9r-rrQrUrerhrjrsrxr{r}rrrrrrrr:r6r4r@r@FsBu88.uDD
:<
<=BB=>
C9
M1:"Br6r@cbeZdZedZdZdZdZdZdZ	e
ddZd	Zd
Z
y)UnicodeMiscTestc8t|tjyN)rr=UCDrds r4test_disallow_instantiationz+UnicodeMiscTest.test_disallow_instantiations	%T;??;r6cd}tjd|}d}|j||jj	dy)NzGimport sys;sys.modules['unicodedata'] = None;eval("'\\N{SOFT HYPHEN}'")z-czUSyntaxError: (unicode error) \N escapes not supported (can't load unicodedata module)rD)rassert_python_failureassertInerrdecode)r.coder3errors    r4#test_failed_import_during_compilingz3UnicodeMiscTest.test_failed_import_during_compilingsA/
44T4@.

eVZZ..w78r6c
d}tdD]_}t|}|jj|d}|dk7s0|j	||jj||dz
}a|j
|dk\yNrrCr
)rrr>rHr,rG
assertTruer.countr0cdecs     r4test_decimal_numeric_consistentz/UnicodeMiscTest.test_decimal_numeric_consistentsxw	AAA''//!R(Cby  dggooa&89
		
$r6c
d}tdD]_}t|}|jj|d}|dk7s0|j	||jj||dz
}a|j
|dk\yr)rrr>rFr,rGrrs     r4test_digit_numeric_consistentz-UnicodeMiscTest.test_digit_numeric_consistent!sxw	AAA''--2&Cby  dggooa&89
		
$r6cZ|j|jjddy)NzGOTHIC LETTER FAIHUu𐍆)r,r>rSrds r4test_bug_1704793z UnicodeMiscTest.test_bug_1704793.s (=>Mr6cpddl}|j|jd|j|jjd|jdj	dk(|jdj	dk(|jdj	dk(y)Nru༺rnrXᵹuꝽ.)r=rrMrr&)r.r=s  r4test_ucd_510zUnicodeMiscTest.test_ucd_5101s,,,X67K11::8DDE	
		S()((23		S()r6rc
b|jdjd|jttjdzDcgc]S}dt|jt|j
zt|jzvr|Uc}dgycc}w)Nrrr)r,r%rrrrr&r')r.rs  r4
test_bug_5828zUnicodeMiscTest.test_bug_5828<s)84 !12
SV\\^CFLLN:3q6<<>II
C	

s
AB,c|jdjd|jdjd|jdjdy)NuDŽuDžudž)r,r'rds r4
test_bug_4971zUnicodeMiscTest.test_bug_4971HsG)84)84)84r6ctdD]a}t|dzj}|dvr |jt	|dd|zC|jt	|dd|zcy)NrrX)
r
i( i) z\u%.4x should be a linebreakrz \u%.4x should not be a linebreak)rr
splitlinesr,len)r.r0liness   r4test_linebreak_7643z#UnicodeMiscTest.test_linebreak_7643Nszw	JAVc\--/E77  UQ!@1!DF  UQ!Dq!HJ	Jr6N)r7r8r9rrrrrrrrrrrr:r6r4rrsR<<9 %%N	*u	
	
5	Jr6rcpeZdZedZedZededdZdZdZ	dZ
y	)
NormalizationTestcF|j}tj|vSr)readliner=unidata_version)testfilehdrs  r4
check_versionzNormalizationTest.check_versionZs!!**c11r6c|jdDcgc]}t|d}}dj|Dcgc]
}t|c}Scc}wcc}w)Nrur)splitintr)r)r2r`s  r4unistrzNormalizationTest.unistr_sI$(JJsO4qAr
44ww-1A-..5-s
AAnetworkrcZd}dtjd|}	t|d|j}5|j|dddy#t$r|jd|dY=ttf$r!}|jd|d	|Yd}~gd}~wwxYw#1swYyxYw)
NzNormalizationTest.txtz"http://www.pythontest.net/unicode//r)encodingcheckz"Permission error when downloading z into the test data directoryzFailed to download z: )	r=rrrPermissionErrorskipTestOSErrorrrun_normalization_tests)r.TESTDATAFILETESTDATAURLtestdataexcs     r4test_normalizationz$NormalizationTest.test_normalizationds/:;;V;V:WWXYeXfg	F'g.2.@.@BH	3((2	3	3
	;MM>{mL9:
;'	FMM/}BseDEE	F	3	3s(AB!B/B=BB!B*cd}i}d}d}d}d}|D]}d|vr|jdd}|j}|s/|jdr|jd}T|jddd	D	cgc]}	|j|	c}	\}
}}}
}|j	|||
cxk(xr||cxk(xr||k(nc||j	|
||
cxk(xr||k(nc||j	|||
cxk(xr||cxk(xr||k(nc||j	|||
cxk(xr||k(nc||j	|
||
cxk(xr5||cxk(xr'||cxk(xr||
cxk(xr||k(nc||j	|||
cxk(xr5||cxk(xr'||cxk(xr||
cxk(xr||k(nc||j	tjd
||j	tjd
|
|j	tjd||j	tjd||j	tjd|
|j	tjd
||dk(sd||
<ttjdzD]Z}t|}||vr|j	|||cxk(xr'||cxk(xr||cxk(xr||k(nc|\ycc}	w)Nc.tjd|S)Nrr=rrLs r4rz6NormalizationTest.run_normalization_tests.<locals>.NFC{((44r6c.tjd|S)NNFKCrrs r4rz7NormalizationTest.run_normalization_tests.<locals>.NFKC~((55r6c.tjd|S)NNFDrrs r4rz6NormalizationTest.run_normalization_tests.<locals>.NFDrr6c.tjd|S)NNFKDrrs r4rz7NormalizationTest.run_normalization_tests.<locals>.NFKDrr6#rz@Part;rCrrrrz@Part1r)rstrip
startswithrrr=
is_normalizedrrrr)r.rpart
part1_datarrrrliner`c1c2c3c4c5rXs                 r4rz)NormalizationTest.run_normalization_testsws
	5	6	5	6"	#Dd{zz#q)::<Dw'zz|A6:jjocr6JKdkk!nKNBr"R
OOB3r7Bs2wB3r7BDIOOB3r76s2w6=OOB3r7Bs2wB3r7BDIOOB3r76s2w6=OOB$r(=d2h= H=(,R=48H= 
"
OOB$r(=d2h= H=(,R=48H= 
"
OOK55eR@AOOK55eR@AOOK55eR@AOOK55eR@AOOK55fbABOOK55fbABx!"
2E"	#Js~~a'(	LAAAJOOAQG3q6GT!WGQGK		L9Ls=M=c|jttj|jttjdd|jtjdddy)Nunknownr_rr)rarbr=rrcr,rds r4test_edge_casesz!NormalizationTest.test_edge_casessO)[%:%:;*k&;&;YM..vr:B?r6c0tjddy)Nru한글rrds r4test_bug_834676z!NormalizationTest.test_bug_834676se^4r6N)r7r8r9staticmethodrrrrrrrr:r6r4rrYs`22//y!u3"3"9Lv@
5r6r__main__)__doc__rhttp.clientrrr=unittesttest.supportrrrrrTestCaser
r<r@rrr7mainr:r6r4<module>rs%
FF/8**/8b(++uB.uBnZJ)ZJx`5))`5FzHMMOr6