mò %U²Ic @sdZdklZlZlZdkZdkZdkZdklZdk l Z d„Z ei dƒZ d„Zddd „Zd „ZxUd"d#fD]G\ZZz$eƒetttteeƒWdettttƒXqšWeo d GHnz(e d dgƒae ddgƒae ddgƒae ddgƒae dttttfƒZeiƒZeedjƒeeiƒd jƒeeiƒd jƒeeiƒtjƒeiƒZee ƒeeiƒd jƒeeiƒdjƒeeiƒtjƒeiƒWdettttƒXeo dGHnz—e d dgƒae ddgƒae dttfƒZeeƒZeeddddddgjƒeeiƒdjƒeeiƒdjƒWdettƒXeo dGHnzse d dgƒaei ƒZ!e!djo d Z!ne de#te!ƒƒZeeƒZeedd!gjƒWdetƒXdS($s, Tests for fileinput module. Nick Mathewson (sverifysverbosesTESTFNN(sStringIO(s FileInputcCs:tt|ƒ}t|dƒ}|i|ƒ|iƒ|S(Ntw( tTESTFNtstrtitnametopentft writelinestlinestclose(RRRR((t0/data/zmath/lib/python2.4/test/test_fileinput.pytwriteTmps   sLINE (\d+) OF FILE (\d+)cGs0x)|D]!}yti|ƒWqqXqWdS(N(tnamesRtostunlink(R R((R tremove_tempfiless icCs‰d|d}tod|d|fGHntd||||fd|ƒ} t | ƒ} | i ƒt t| ƒdjƒt | dd jƒt | d d jƒt | iƒdjƒt | iƒ|jƒtod |d|fGHntd||||fd|ƒ} d } x%| o| djo| iƒ} qWt | iƒ|jƒt | iƒdjƒt | iƒdjƒt | iƒ ƒt | iƒ ƒtod|d|fGHn| iƒt | iƒdjƒt | iƒdjƒ| i ƒtod|d|fGHntd||||dfd|ƒ} ti}zitdƒt_t | ƒ} t t| ƒdjƒt | ddjƒt | iƒdjƒ| iƒWd|t_Xtod|d|fGHntd||||fd|ƒ} t | iƒdjƒt | iƒdjƒ| iƒt | iƒdjƒt | iƒdjƒtod|d|fGHnti} z[td||||fddd|ƒ} x#| D]} | d iƒ} | GHq¶W| i ƒWd| t_Xtd||||fd|ƒ} xj| D]b} t | d d!jƒt i!| d ƒ}t |djƒt t#|i$dƒƒ| iƒjƒqW| i ƒdS("Niis%s. Simple iteration (bs=%s)itfilestbufsizeiisLine 5 of file 1 isLine 1 of file 4 s%s. Status variables (bs=%s)txsLine 6 of file 2 is%s. Nextfile (bs=%s)isLine 1 of file 3 is%s. Stdin (bs=%s)it-s Line 1 of stdin Line 2 of stdin i!i sLine 2 of stdin ss%s. Boundary conditions (bs=%s)s%s. Inplace (bs=%s)itinplaceiÿÿÿÿs (%troundtstarttverbosetbst FileInputtt1tt2tt3tt4tfitlistRR tverifytlentlinenotfilenametstreadlinet filelinenot isfirstlinetisstdintnextfiletsyststdint savestdintStringIOtNonetstdoutt savestdouttlinetuppertpattmatchtmtinttgroup(RRRRRRR,RR5RR1R0RR$((R trunTests"sŒ!  !  $   !  '  !)cCsätdg}tdƒD]}|d|dq~ƒatdg}tdƒD]}|d|dqO~ƒatdg}tdƒD]}|d |dq‡~ƒatd g}tdƒD]}|d |dq¿~ƒadS( NiisLine %s of file 1 ii sLine %s of file 2 iisLine %s of file 3 isLine %s of file 4 (R t_[1]trangeRRRRR(RR9((R t writeFilesns 888iis13. 0-byte filestiisThe only line there is. iRs%14. Files that don't end with newlinesA B CsD E FsA sB tCsD sE tFis15. Unicode filenamessA BtasciitB(ii(ii($t__doc__ttest.test_supportR RRR*R treR-t fileinputRR tcompileR3RR8R;RRRRRRRR%R1R"R&R#R RRtgetfilesystemencodingtencodingR.tunicode(RRGR;RRR3R RCRRR*RRR1R R8R-R R((R t?sz   L        "