python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_linecache.cpython-312.opt-2.pyc

Αe&	ddlZddlZddlZddlZddlZddlmZddlm	Z	ejZedzZdZ
dZejj!e
Zdj%Zejj!eZdZd	Zd
ZGddZGd
deZGddeZGddeej6ZGddeej6ZGddeej6ZGddeej6ZGddeej6Z Gddej6Z!Gddej6Z"e#dk(rejHyy) N)support)	os_helperz.missingz
!@$)(!@#_1z
linecache abcz3
" Docstring "

def function():
    return result

z%
def f():
    return 1 + 1

a = f()

z
def f():
    return 3ceZdZfdZxZS)TempFilec$t|tjd5}|j|_|j
|jddd|jtj|j
y#1swY4xYw)NF)delete)supersetUptempfileNamedTemporaryFilename	file_namewritefile_byte_string
addCleanuprunlink)selffp	__class__s  G/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_linecache.pyrzTempFile.setUp+sh



(
(
6	,"WWDNHHT**+	,	
	(($..9	,	,s-BB)__name__
__module____qualname__r
__classcell__rs@rrr)s
::rc*eZdZfdZdZdZxZS)GetLineTestsGoodDatacdj|jjd|_t|y)Nrutf-8)join	file_listencoderr
r)rrs rrzGetLineTestsGoodData.setUp6s, " 7 > >w G

rc*tj|j5}t|D]P\}}|j	ds|dz
}tj|j|dz}|j||R	dddy#1swYyxYw)N
)tokenizeopenr	enumerateendswith	linecachegetlineassertEqual)rrindexlinecached_lines     rtest_getlinez!GetLineTestsGoodData.test_getline:s
]]4>>
*	4b(}
4t}}T*DLD'//	J  {3
4	4	4	4sAB		Bcztj|j}|j||jyN)r,getlinesrr.r#rliness  r
test_getlinesz"GetLineTestsGoodData.test_getlinesCs*""4>>2/r)rrrrr2r8rrs@rrr3s40rrceZdZdZdZy)GetLineTestsBadDatacd|jtj|jddy)Nr'r)r.r,r-rrs rr2z GetLineTestsBadData.test_getlineKs#**4>>1=rBrcb|jtj|jgyr4)r.r,r5rr<s rr8z!GetLineTestsBadData.test_getlinesNs!++DNN;R@rN)rrrr2r8rrr:r:HsCArr:ceZdZgZy)	EmptyFileNrrrr#r>rrr@r@RsIrr@ceZdZdgZy)SingleEmptyLiner&NrAr>rrrCrCVs	IrrCceZdZgdZy)GoodUnicode)uá
zb
zabcdef
uááááá
NrAr>rrrErEZs;IrrEceZdZdZy)BadUnicode_NoDeclarations
abcNrrrrr>rrrGrG]s#rrGceZdZdZy)BadUnicode_WithDeclarations# coding=utf-8
abcNrHr>rrrJrJ`s1rrJcNeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
y)
LineCacheTestsctj}|j|tdt|j|tdt|jt|td|j|tdt|j|tdttD]o}tjjt|dz}t|d5}t|D]!\}}|j||||dz#	dddqtjd}|j|gy#1swYxYw)	Nig?r'.pyr!encodingza/b/c/__init__.py)r,r-r.FILENAMEEMPTYassertRaises	TypeErrorINVALID_NAMEMODULESospathr"MODULE_PATHr)r*r5)rr-entryfilenamefiler/r0emptys        rr2zLineCacheTests.test_getlinefs1##	
51592.6	
)Wh<	
*E2q159	IEww||K7%?Hh1
IT#,T?IKE4$$T78UQY+GHI
I
I	I""#67#

I
Is.0EE	cZ|jtjtjt	tjdd5}|jtdddtjtj}|j|gdy#1swYAxYw)Nwr!rP)r&z	def f():
z
    return 3
)
rrrTESTFNr)rSOURCE_3r,r5r.)rrr7s   rtest_no_ending_newlinez%LineCacheTests.test_no_ending_newlinesx	(()*:*:;
)""C'
:	bHHX	""9#3#34 FG		sB!!B*cg}tD]P}tjjt|dz}|j|t
j|dR|j|g|Dcgc]}|tjvs|}}|j|gt
j|Dcgc]}|tjvs|}}|j|gycc}wcc}w)NrOr')rWrXrYr"rZappendr,r-assertNotEqualcacher.
clearcache)rcachedr[r\fncached_emptys      rtest_clearcachezLineCacheTests.test_clearcaches	+Eww||K7%?HMM(#h*	+	
FB'%+Irr/HIIr*	%+ErrY__/DEEr*
J
Fs2C+
C+:C0C0c
tj}tjdz}|j	tj
|t
|dd5}|jtddd||dg}t
|d5}t|D]2\}}|j||||dz|j|4	dddt
|dd5}|jtdddtjdt|D]!\}}|j||||dz#tj|t
|d5}t|D]2\}}|j||||dz|j|4	dddy#1swYIxYw#1swYxYw#1swYxYw#1swYyxYw)NrOr`r!rPr'dummy)r,r-rrarrr)rSOURCE_1r*r.reSOURCE_2
checkcache)rr-source_namesourcesource_listr/r0s       rtest_checkcachezLineCacheTests.test_checkcaches##&&.	((+6
+sW
5	#LL"	#Q
+
0	)F(0
)t  w{EAI'FG""4(
)	)
+sW
5	#LL"	#	W%%[1	DKE4T7;	#BC	D	[)
+
0	)F(0
)t  w{EAI'FG""4(
)	)	)/	#	#	)	)
	#	#	)	)s2F/AF< G$AG/F9<GGGctjt}tj|j	dtj
td|j	|tjty)NF)r,r5rRrhr.	lazycacher6s  rtest_lazycache_no_globalsz(LineCacheTests.test_lazycache_no_globalssV""8,	 3 3Hd CD	 2 28 <=rctjtt}tj|jdtjtt|jdttjt|j|tjty)NTr')	r,r5NONEXISTENT_FILENAMEglobalsrhr.rwlenrgr6s  rtest_lazycache_smokez#LineCacheTests.test_lazycache_smokes""#7C)%%&:GIF	HC	0D EFG	
	 2 23G HIrc`tjtjtt	}tjtjttj
tt	|j
|tjtyr4)r,rhr5rzr{rwr.updatecacher6s  r*test_lazycache_provide_after_failed_lookupz9LineCacheTests.test_lazycache_provide_after_failed_lookupsm""#7C/00')<	 5 56J KLrctjtjtt	tj
yr4)r,rhrwrzr{rqr<s rtest_lazycache_checkz#LineCacheTests.test_lazycache_checks-0')<rctj|jdtjdt	|jdtjdt	y)NFrz<foo>)r,rhr.rwr{r<s rtest_lazycache_bad_filenamez*LineCacheTests.test_lazycache_bad_filenamesL	 3 3B	 BC	 3 3GWY GHrc4tjtjtt	}|jdtjtt	|jdttjty)NF)	r,rhr5rzr{r.rwr|rgr6s  rtest_lazycache_already_cachedz,LineCacheTests.test_lazycache_already_cachedsi""#7C 4gi@	B	
C	0D EFGrcDtjt}|j|d}t	j
td|5tjt}ddd|j
|tjt	j
td|5tjt}ddd|j
g|j
tjt|y#1swYxYw#1swYQxYw)Nctr4)MemoryError)argskwargss  rraise_memoryerrorz:LineCacheTests.test_memoryerror.<locals>.raise_memoryerrorsrr)r,r5rR
assertTruer	swap_attrr.rh)rr7rlines2lines3s     rtest_memoryerrorzLineCacheTests.test_memoryerrors""8,	


y-9J
K	2''1F	2'


y-9J
K	2''1F	2$++H5u=	2	2
	2	2s	D
,D
DDN)rrrr2rcrlrurxr}rrrrrr>rrrLrLds?$2H+")B>JM
I
H
>rrLc0eZdZfdZdZdZdZxZS)LineCacheInvalidationTestsc>t|tjtj
dz|_tj
dz|_tj
dz|_|j|j|jfD]}|jtj|t|dd5}|jd|dddd|j|tjtj||j!|tjt#j$|jt|jdd5}|jd	dddy#1swYxYw#1swYyxYw)
Nz.1z.2z.3r`r!rPzprint("I am z")zprint("was modified"))r
rr,rhrradeleted_file
modified_fileunchanged_filerrr)rassertNotInrgr5assertInrXremove)rfnamersrs   rrz LineCacheInvalidationTests.setUpsP

%,,t3&--4'..5''(())+		2E
OOI,,e4eS73
7v|E7"56
7
UIOO4u%MM%1		2			$##$
$$$cG
<	2LL01	2	2
7
7	2	2sF,FF	Fc>tj|j|j|jtj|j|jtj|j|jtjyr4)r,rqrrrgrrrr<s r test_checkcache_for_deleted_filez;LineCacheInvalidationTests.test_checkcache_for_deleted_file	s`T../**IOO<

d(()//:

d))9??;rc>tj|j|j|jtj
|j
|jtj
|j|jtj
yr4)r,rqrrrrgrrr<s r!test_checkcache_for_modified_filez<LineCacheInvalidationTests.test_checkcache_for_modified_files`T//0

d''9++Y__=

d))9??;rc(tj|j|jtj|j|j
tj|j
|jtjyr4)r,rqrrrgrrrr<s r!test_checkcache_with_no_parameterz<LineCacheInvalidationTests.test_checkcache_with_no_parametersZ**IOO<++Y__=

d))9??;r)rrrrrrrrrs@rrrs2,<<<rr__main__)%r,unittestos.pathrXrr(testrtest.supportr__file__rRrzrVrSrYdirname	TEST_PATHsplitrWrZrorprbrrr:TestCaser@rCrErGrJrLrrmainr>rr<module>rsU&"*,
GGOOH%	



!ggooh'
::080*A(A$h&7&7*H,=,=<&(9(9<$2H4E4E$2!4h6G6G2K>X&&K>\'<!2!2'<TzHMMOr