%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_sort.pyc

ó
Nêáac@sÆddlmZddlZddlZddlZejZdadd„Zdej	fd„ƒYZ
dej	fd„ƒYZd	ej	fd
„ƒYZdd„Z
edkrÂe
d
eƒndS(iÿÿÿÿ(ttest_supportNicCsþtrdG|GHn|}|r/|j|ƒn
|jƒt|ƒt|ƒkrdG|GHdGt|ƒGt|ƒGH|GH|GH|GHtd7adSxgt|ƒD]Y\}}||}||k	rdG|GHdG|G|G|GH|GH|GH|GHtd7adSqWdS(Ns    checkingserror inslength mismatch;isout of order at index(tverbosetsorttlentnerrorst	enumerate(ttagtexpectedtrawtcomparetorigtitgoodtmaybe((s*/usr/local/lib/python2.7/test/test_sort.pytcheck	s0
	

	
tTestBasecBseZd„ZRS(cs¢dg}x?tddƒD].}d|}|jt|d|dƒƒqW|jdddgƒdtf‡fd†ƒY‰d	tfd
„ƒY}x|D]}t|ƒ}tr¾dG|GHn|}td||ƒ|}|jƒtd
||ƒ|}tj|ƒtd||ƒ|}|jƒ|}td||d„ƒtr[dGHdGHn|}|jd„ƒtd||ƒg|D]}ˆ|ƒ^q‰}|}tj|ƒt	ˆ_
t}	y|jƒWntk
rët	}	nX|	rtˆ_
td||ƒngt
|ƒD]}|tjdƒ|ƒ^q}g|D]}
|
|
jf^qF}|jƒg|D]\}
}|
^qr}td||ƒqšWdS(Niii
iidièt	Complainscs/eZeZd„Z‡fd†Zd„ZRS(cSs
||_dS(N(R(tselfR((s*/usr/local/lib/python2.7/test/test_sort.pyt__init__5scsJˆjr:tjƒdkr:tr1dG|G|GHnt‚n|j|jkS(Ngü©ñÒMbP?s        complaining at(tmaybe_complaintrandomRtRuntimeErrorR(Rtother(R(s*/usr/local/lib/python2.7/test/test_sort.pyt__lt__8s
	cSsd|jS(Ns
Complains(%d)(R(R((s*/usr/local/lib/python2.7/test/test_sort.pyt__repr__?s(t__name__t
__module__tTrueRRRR((R(s*/usr/local/lib/python2.7/test/test_sort.pyR2s	tStablecBs)eZd„Zd„ZdZd„ZRS(cSs||_||_dS(N(tkeytindex(RRR((s*/usr/local/lib/python2.7/test/test_sort.pyRCs	cSst|j|jƒS(N(tcmpR(RR((s*/usr/local/lib/python2.7/test/test_sort.pyt__cmp__GscSsd|j|jfS(NsStable(%d, %d)(RR(R((s*/usr/local/lib/python2.7/test/test_sort.pyRKsN(RRRR tNonet__hash__R(((s*/usr/local/lib/python2.7/test/test_sort.pyRBs		sTesting sizetidentitytreversedsrandom permutationsreversed via functioncSs
t||ƒS(N(R(tatb((s*/usr/local/lib/python2.7/test/test_sort.pyt<lambda>ats3    Checking against an insane comparison function.s?        If the implementation isn't careful, this may segfault.cSsttjƒdƒdS(Nii(tintR(R%R&((s*/usr/local/lib/python2.7/test/test_sort.pyR'gR(s(an insane function left some permutations+exception during sort left some permutationt	stability(trangetextendtobjectRRtreverseRtshuffleRRRtFalseRtxranget	randrangeR(RtsizestpowertnRtxtstyRt
it_complainedtet	augmented((Rs*/usr/local/lib/python2.7/test/test_sort.pyttestStressfully*s\	
"




	

	1"
(RRR<(((s*/usr/local/lib/python2.7/test/test_sort.pyR)stTestBugscBs#eZd„Zd„Zd„ZRS(csRdd‡fd†ƒY}gtdƒD]}|ƒ^q&‰|jtˆjƒdS(NtCcseZ‡fd†ZRS(csBˆr%tjƒdkr%ˆjƒn
ˆjdƒtjƒdkS(Ngè?igà?(Rtpoptappend(RR(tL(s*/usr/local/lib/python2.7/test/test_sort.pyR‡s

(RRR((RA(s*/usr/local/lib/python2.7/test/test_sort.pyR>†si2((R+tassertRaisest
ValueErrorR(RR>R((RAs*/usr/local/lib/python2.7/test/test_sort.pyttest_bug453523s"cCs@tdƒ}tj|ƒ|jdƒ|j|tdƒƒdS(Ni2(R+RR/RR!tassertEqual(RRA((s*/usr/local/lib/python2.7/test/test_sort.pyttest_cmpNone‘s

cs€g}xstdƒD]e}‡fd†}ddg‰|jtˆj|ƒ‡fd†}|jtˆj|ƒ|g}qWdS(Nics$ˆjdƒˆjƒt||ƒS(Ni(R@R?R(R6R8(RA(s*/usr/local/lib/python2.7/test/test_sort.pytmutating_cmps

iicsˆjdƒˆ2t||ƒS(Ni(R@R(R6R8(RA(s*/usr/local/lib/python2.7/test/test_sort.pyRG£s
(R+RBRCR(RtmemorywasterRRG((RAs*/usr/local/lib/python2.7/test/test_sort.pyttest_undetected_mutation™s(RRRDRFRI(((s*/usr/local/lib/python2.7/test/test_sort.pyR=s		tTestDecorateSortUndecoratecBskeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZRS(cCsJdjƒ}|}tj|ƒ|jdtjƒ|jdd„ƒdS(Ns,The quick Brown fox Jumped over The lazy DogRRcSst|jƒ|jƒƒS(N(Rtlower(R6R8((s*/usr/local/lib/python2.7/test/test_sort.pyR'³R((tsplitRR/RtstrRK(Rtdatatcopy((s*/usr/local/lib/python2.7/test/test_sort.pyttest_decorated®s

cCs,djƒ}|jt|jdd„ƒdS(Ns,The quick Brown fox Jumped over The lazy DogcSsdS(Ni((R6R8((s*/usr/local/lib/python2.7/test/test_sort.pyR'·R((RLRBt	TypeErrorRR!(RRN((s*/usr/local/lib/python2.7/test/test_sort.pyttest_baddecoratorµscCsfgtdƒD]}tjdƒ|f^q
}|}|jdd„ƒ|jƒ|j||ƒdS(NiÈidRcSs|dS(Ni((R6((s*/usr/local/lib/python2.7/test/test_sort.pyR'¼R((R1RR2RRE(RRRNRO((s*/usr/local/lib/python2.7/test/test_sort.pyttest_stability¹s
.
cs8‡fd†}djƒ}|jd|dtjƒdS(Ncs9ˆjt|ƒtƒˆjt|ƒtƒt||ƒS(N(REttypeRMR(R6R8(R(s*/usr/local/lib/python2.7/test/test_sort.pyR	Âss,The quick Brown fox Jumped over The lazy DogRR(RLRRMRK(RR	RN((Rs*/usr/local/lib/python2.7/test/test_sort.pyttest_cmp_and_key_combinationÀscCs,djƒ}|jt|jdtjƒdS(Ns,The quick Brown fox Jumped over The lazy Dogtbad(RLRBRQRRMRK(RRN((s*/usr/local/lib/python2.7/test/test_sort.pyttest_badcmp_with_keyÉscCsFtddƒ}|}|jt|jdd„ƒ|j||ƒdS(NiþÿÿÿicSsd|S(Ni((R6((s*/usr/local/lib/python2.7/test/test_sort.pyR'ÒR((R+RBtZeroDivisionErrorRR!RE(RRNtdup((s*/usr/local/lib/python2.7/test/test_sort.pyttest_key_with_exceptionÎscs8tdƒ‰‡fd†}|jtˆjd|ƒdS(Ni
csˆ2tdƒˆ(|S(Ni(R+(R6(RN(s*/usr/local/lib/python2.7/test/test_sort.pytk×s
R(R+RBRCR(RR[((RNs*/usr/local/lib/python2.7/test/test_sort.pyttest_key_with_mutationÕscsEtdƒ‰dtf‡fd†ƒY}|jtˆjd|ƒdS(Ni
t
SortKillercs eZd„Z‡fd†ZRS(cSsdS(N((RR6((s*/usr/local/lib/python2.7/test/test_sort.pyRàscsˆ2tdƒˆ(dS(Ni(R+(R(RN(s*/usr/local/lib/python2.7/test/test_sort.pyt__del__âs(RRRR^((RN(s*/usr/local/lib/python2.7/test/test_sort.pyR]ßs	R(R+R-RBRCR(RR]((RNs*/usr/local/lib/python2.7/test/test_sort.pyttest_key_with_mutating_delÝscsEtdƒ‰dtf‡fd†ƒY}|jtˆjd|ƒdS(Ni
R]cs eZd„Z‡fd†ZRS(cSs|dkrt‚ndS(Ni(R(RR6((s*/usr/local/lib/python2.7/test/test_sort.pyRëscsˆ2tdƒˆ(dS(Ni(R+(R(RN(s*/usr/local/lib/python2.7/test/test_sort.pyR^îs(RRRR^((RN(s*/usr/local/lib/python2.7/test/test_sort.pyR]ês	R(R+R-RBRR(RR]((RNs*/usr/local/lib/python2.7/test/test_sort.pyt(test_key_with_mutating_del_and_exceptionçscCs_tdƒ}tj|ƒ|jdtƒ|j|tdddƒƒ|jt|jdƒdS(NidR.iciÿÿÿÿs
wrong type(R+RR/RRRERBRQ(RRN((s*/usr/local/lib/python2.7/test/test_sort.pyttest_reverseûs

cCs¥gtdƒD]}tjdƒ|f^q
}|}|}|jdd„dtƒ|jdd„ƒ|j||ƒ|jdd„dtƒ|j||ƒdS(	NiÈidRcSst|d|dƒS(Ni(R(R6R8((s*/usr/local/lib/python2.7/test/test_sort.pyR'R(R.cSst|d|dƒS(Ni(R(R6R8((s*/usr/local/lib/python2.7/test/test_sort.pyR'R(RcSs|dS(Ni((R6((s*/usr/local/lib/python2.7/test/test_sort.pyR'	R((R1RR2RRRE(RRRNtcopy1tcopy2((s*/usr/local/lib/python2.7/test/test_sort.pyttest_reverse_stabilitys.(
RRRPRRRSRURWRZR\R_R`RaRd(((s*/usr/local/lib/python2.7/test/test_sort.pyRJ¬s									
		cCs¶tttf}tjdtfƒŒtj|Œ|r¬ttdƒr¬ddl	}dgd}xAtt|ƒƒD]-}tj|Œ|j
ƒtjƒ||<qsW|GHnWdQXdS(Ns!the cmp argument is not supportedtgettotalrefcountiÿÿÿÿi(RRJR=Rtcheck_py3k_warningstDeprecationWarningtrun_unittestthasattrtsystgcR!R1RtcollectRe(Rttest_classesRktcountsR((s*/usr/local/lib/python2.7/test/test_sort.pyt	test_mains	



t__main__R(ttestRRRjtunittestRRR!RtTestCaseRR=RJRoRR(((s*/usr/local/lib/python2.7/test/test_sort.pyt<module>s	 V-b

Zerion Mini Shell 1.0