+
    Bi>                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 R t
 ! R R]P                  4      t ! R R]P                  4      t]R	8X  d   ]P                  ! 4        R# R# )
    N)support)	os_helperc                j   \         P                  ! W4       \        VR4      ;_uu_ 4       p\        VP	                  ^4      4      pV^ ,          ^,           R,          V^ &   VP                  ^ 4       VP                  V4       RRR4       \         P                  ! W4       R#   + '       g   i     L(; i)zAcreate a file with the same size and mtime but different content.zr+b   N)shutilcopy2open	bytearrayreadseekwritecopystat)template_pathnew_pathf	next_chars   &&  (/usr/lib/python3.14/test/test_filecmp.py_create_file_shallow_equalr      sy    
LL)	h		!affQi(	!!q(C/	!	q				 

 OOM, 
	s   AB""B2	c                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )FileCompareTestCasec                F   \         P                  V n        \         P                  R ,           V n        \         P                  R,           V n        \         P                  R,           V n        RpV P                  V P                  V P                  3 F3  p\        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       K5  	  \        V P                  RRR7      ;_uu_ 4       pVP                  R	4       RRR4       V P                  V P                  3 F$  p\        P                  ! V P                  V4       K&  	  \        V P                  V P
                  4       \        P                  ! 4       V n        R#   + '       g   i     K  ; i  + '       g   i     L; i)
z-samez-diffz-same-shallowContents of file go here.
wutf-8encodingNza+zAn extra line.
)r   TESTFNname	name_same	name_diffname_same_shallowr	   r   r   r   r   tempfile
gettempdirdir)selfdatar   outputs   &   r   setUpFileCompareTestCase.setUp   s   $$	"))G3"))G3!*!1!1O!C,YY?DdC'22fT" 32 @ $..$99VLL+, : ^^T^^4DOODIIt, 5 	#499d.D.DE&&( 322 :9s   (E<&F<FF 	c                   \         P                  ! V P                  4       \         P                  ! V P                  4       \         P                  ! V P                  4       \         P                  ! V P
                  4       R # N)osunlinkr   r   r    r!   r%   s   &r   tearDownFileCompareTestCase.tearDown-   sD    
		$))
		$..!
		$..!
		$(()    c                \   V P                  \        P                  ! V P                  V P                  4      R 4       V P                  \        P                  ! V P                  V P                  RR7      R 4       V P                  \        P                  ! V P                  V P                  4      R4       V P                  \        P                  ! V P                  V P                  RR7      R4       V P                  \        P                  ! V P                  V P
                  4      R4       R# )zComparing file to itself failsFshallowz&Comparing file to identical file failsz2Shallow identical files should be considered equalN)
assertTruefilecmpcmpr   r   r!   r.   s   &r   test_matching!FileCompareTestCase.test_matching3   s    DIItyy98	:DIItyy%H8	:DIIt~~>@	BDIIt~~uM@	BDIIt/E/EFL	Nr1   c                l   V P                  \        P                  ! V P                  V P                  4      R 4       V P                  \        P                  ! V P                  V P
                  4      R4       V P                  \        P                  ! V P                  V P                  RR7      R4       R# )z!Mismatched files compare as equalz#File and directory compare as equalFr3   z;Mismatched file to shallow identical file compares as equalN)assertFalser6   r7   r   r    r$   r!   r.   s   &r   test_different"FileCompareTestCase.test_different?   s|    TYY?7	9TYY99	;TYY0F0F-24U	Wr1   c                <   \         P                  ! V P                  V P                  R R7      p\         P                  ! V P                  V P                  R R7      p\         P
                  ! 4        V P                  \        \         P                  4      ^ 8H  R4       R# )Fr3   z+Cache not cleared after calling clear_cacheN)	r6   r7   r   r   r    clear_cacher5   len_cache)r%   first_comparesecond_compares   &  r   test_cache_clear$FileCompareTestCase.test_cache_clearH   sb    DIIt~~uM TYYNGNN+q0E	Gr1   )r$   r   r    r   r!   N)__name__
__module____qualname____firstlineno__r(   r/   r8   r<   rD   __static_attributes____classdictcell____classdict__s   @r   r   r      s'     )(*
NWG Gr1   r   c                      a  ] tR t^Ot 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R tR tR tR tR tR tR tRtV tR# )DirCompareTestCasec                6   \         P                  ! 4       p\        P                  P	                  VR 4      V n        \        P                  P	                  VR4      V n        \        P                  P	                  VR4      V n        \        P                  P	                  VR4      V n        \        P                  P	                  VR4      V n	        \        P                  P	                  V P                  R4      V n
        \        P                  P                  R4      \        P                  P                  R4      8H  V n        Rp\        P                  ! V P
                  R	4       \        P                  ! V P
                  4       \        P                  P	                  V P
                  R
4      p\        P                  ! V4       \        P                  P	                  V P
                  R4      p\!        VRRR7      ;_uu_ 4       pVP#                  V4       RRR4       V P                  V P                  V P                  V P                  3 F  p\        P                  ! VR	4       \        P                  ! V4       \        P                  P	                  VR
4      p\        P                  ! V4       V P                  '       d   W`P                  J d   RpMRp\        P                  P	                  Wg4      pW`P                  J d   \%        WH4       K  \        P&                  ! WH4       K  	  \!        \        P                  P	                  V P                  R4      RRR7      ;_uu_ 4       pVP#                  R4       RRR4       \!        \        P                  P	                  V P                  R4      RRR7      ;_uu_ 4       pVP#                  R4       RRR4       R#   + '       g   i     EL; i  + '       g   i     L~; i  + '       g   i     R# ; i)r$   zdir-samezdir-diffzdir-diff-filezdir-same-shallow.hgAar   Tsubdirfiler   r   r   NFiLefile2zAn extra file.
zDifferent contents.
)r"   r#   r,   pathjoinr$   dir_samedir_diffdir_diff_filedir_same_shallowdir_ignorednormcasecaseinsensitiver   rmtreemkdirr	   r   r   r   )	r%   tmpdirr&   subdir_pathdir_file_pathr'   r$   fn	file_paths	   &        r   r(   DirCompareTestCase.setUpP   s   $$&77<<.VZ8VZ8WW\\&/B "V5G H 77<<u=!ww//48H8H8MM,dhh%
ggll488X6
TXXv6-w776LL 8 MM4#8#8MM4#5#57CMM#t$HHSM'',,sH5KHH[!###}}(<S-I+++*=D]6!7$ "'',,t}}g6gNNRXLL+, O "'',,t117;S7SSW]LL01 TS3 877* ON TSSs$   O ,O4P O1	4P	P	c                    V P                   V P                  V P                  V P                  V P                  3 F  p\
        P                  ! V4       K  	  R # r+   )r$   rZ   r[   r]   r\   r   ra   )r%   r$   s   & r   r/   DirCompareTestCase.tearDown   s>    HHdmmT]]))4+=+=?CMM#?r1   c                F    V P                  R \        P                  4       R# )rQ   N)assertInr6   DEFAULT_IGNORESr.   s   &r   test_default_ignores'DirCompareTestCase.test_default_ignores   s    eW445r1   c           	        V P                  \        P                  ! V P                  V P                  R .4      R .. . 38H  R4       V P                  \        P                  ! V P                  V P                  R .4      R .. . 38H  R4       V P                  \        P                  ! V P                  V P                  R .RR7      R .. . 38H  R4       V P                  \        P                  ! V P                  V P                  R .RR7      R4       V P                  \        P                  ! V P                  V P                  R R.4      R .R.. 38H  R4       R# )rU   z#Comparing directory to itself failsz!Comparing directory to same failsFr3   rW   z&Comparing mismatched directories failsN)r5   r6   cmpfilesr$   rZ   r;   r\   r.   s   &r   test_cmpfiles DirCompareTestCase.test_cmpfiles   s:   ((488fXF 2r*+=	? 	((4==6(K 2r*+;	=
 	((488fX168 2r*+ >	? 	((4==6(168;	= 	))$((D4F4F&,g%68Xy"-. =	>r1   c           
        R\         R ,           R3R	RR,          R33 F  w  rV P                  V P                  V P                  3 Fb  pV P	                  RV 2VR7      ;_uu_ 4        \
        P                  ! V P                  W1.4      pV P                  V. . V.34       RRR4       Kd  	  K  	  R#   + '       g   i     K}  ; i)
 z filename with embedded NUL bytesrS   @B zvery long filenamez
cmpfiles: )	other_dirN)ru   zNUL bytes filename)u	   .py'surrogate codes (MUSICAL SYMBOL G CLEF))__file__r$   rZ   r[   subTestr6   rq   assertTupleEqual)r%   rU   descrw   ress   &    r   test_cmpfiles_invalid_names.DirCompareTestCase.test_cmpfiles_invalid_names   s     + BCJ9_23	
JD #hht}}E	\\Jtf"5\KK!**488YGC))#B/?@ LK F
 LKKs   &9B1	1Cc                
   RR\         P                   R2R3RRR,          R33 EF  w  r\        P                  ! V P                  V4      p\        P                  ! WP                  4      pR F  pV P                  RV 2VR7      ;_uu_ 4        V P                  \        \        34      ;_uu_ 4        \        W54       R	R	R	4       R	R	R	4       V P                  R
V 2VR7      ;_uu_ 4        V P                  \        \        34      ;_uu_ 4        \        WE4       R	R	R	4       R	R	R	4       K  	  EK  	  R	#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LI; i  + '       g   i     EK  ; i)ru   TopzMid zdirname with embedded NUL bytesrS   rv   zvery long dirnamezdircmp(ok, bad): )targetNzdircmp(bad, ok): )ru   zNUL bytes dirname)u   rx   )	left_list
right_list	left_only
right_onlycommon)
r,   sepr6   dircmpr$   rz   assertRaisesOSError
ValueErrorgetattr)r%   bad_dirr|   d1d2r   s   &     r   test_dircmp_invalid_names,DirCompareTestCase.test_dircmp_invalid_names   s)   )266('"$EFG9_12	
MG '2B2B
 \\$5dV"<V\LL**GZ+@AA+ B M \\$5dV"<V\LL**GZ+@AA+ B ML
 BA ML BA MLLsH   $E
	2D7>E
	,$E0	EE0	7EE
	
EE-(E0	0Fc                N    V P                  \        V4      \        V4      4       R# )z0Assert that two lists are equal, up to ordering.N)assertEqualsorted)r%   actualexpecteds   &&&r   _assert_lists DirCompareTestCase._assert_lists   s    )9:r1   c                J    V P                  4        V P                  R R7       R# Fr3   N)$_assert_dircmp_identical_directoriesr.   s   &r   !test_dircmp_identical_directories4DirCompareTestCase.test_dircmp_identical_directories       11311%1@r1   c                J    V P                  4        V P                  R R7       R# r   )_assert_dircmp_different_filer.   s   &r   test_dircmp_different_file-DirCompareTestCase.test_dircmp_different_file   s    **,**5*9r1   c                J    V P                  4        V P                  R R7       R# r   )$_assert_dircmp_different_directoriesr.   s   &r   !test_dircmp_different_directories4DirCompareTestCase.test_dircmp_different_directories   r   r1   c                   V P                   V P                  r2\        P                  ! W#3/ VB pV P	                  VP
                  V4       V P	                  VP                  V4       V P                  '       d>   V P                  VP                  R R.4       V P                  VP                  RR.4       M<V P                  VP                  R R.4       V P                  VP                  R R.4       V P                  VP                  R R.4       V P                  VP                  R.4       V P	                  VP                  . 4       V P	                  VP                  . 4       V P	                  VP                  R .4       V P	                  VP                   . 4       RP#                  V P                   V P                  4      RR.pV P%                  VP&                  V4       R# )rU   rT   rV   
diff {} {}Identical files : ['file']"Common subdirectories : ['subdir']N)r$   rZ   r6   r   r   leftrightr`   r   r   r   r   common_dirsr   r   
same_files
diff_filesformat_assert_reportreportr%   optionsleft_dir	right_dirdexpected_reports   &,    r   r   7DirCompareTestCase._assert_dircmp_identical_directories   sx   "hh)NN8:':*),q{{VX,>?q||fh-?@q{{VX,>?q||fh-?@188fh%781==8*5b)r*x0r*$--8(0

 	AHHo6r1   c                   V P                   V P                  r2\        P                  ! W#3/ VB pV P	                  VP
                  V4       V P	                  VP                  V4       V P                  VP                  R R.4       V P                  VP                  . RO4       V P                  VP                  R R.4       V P                  VP                  R.4       V P	                  VP                  . 4       V P	                  VP                  R.4       V P	                  VP                  R .4       V P	                  VP                  . 4       RP!                  V P                   V P                  4      RP!                  V P                  4      RR.pV P#                  VP$                  V4       V P                  V P                   r2\        P                  ! W#3/ VB pV P	                  VP
                  V4       V P	                  VP                  V4       V P                  VP                  . RO4       V P                  VP                  R R.4       V P                  VP                  R R.4       V P	                  VP                  R.4       V P	                  VP                  . 4       V P	                  VP                  R .4       V P	                  VP                  . 4       RP!                  V P                  V P                   4      RP!                  V P                  4      RR.pV P#                  VP$                  V4       R# )	rU   rT   rW   r   zOnly in {} : ['file2']r   r   N)rU   rW   rT   )r$   r[   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &,    r   r   7DirCompareTestCase._assert_dircmp_different_directories   s~   "hh)NN8:':*),1;;(:;1<<)DE188fh%781==8*5b)y1x0r*$--8$++DMM:(0	
 	AHHo6 #mmTXX)NN8:':*),1;;(CD1<<&();<188fh%78wi0r*x0r*txx8$++DMM:(0	
 	AHHo6r1   c                ^   \         P                  ! V P                  V P                  3/ VB pV P	                  VP
                  R .4       V P	                  VP                  R.4       RP                  V P                  V P                  4      RRR.pV P                  VP                  V4       R# )rU   rW   r   r   zDiffering files : ['file2']r   N)
r6   r   r[   r\   r   r   r   r   r   r   )r%   r   r   r   s   &,  r   r   0DirCompareTestCase._assert_dircmp_different_file  s    NN4==$*<*<HHx0y1t/A/AB()0	
 	AHHo6r1   c                \   \         P                  ! V P                  V P                  R R7      pV P	                  VP
                  . 4       V P	                  VP                  R.4       RP                  V P                  V P                  4      RR.pV P                  VP                  V4       R# )Fr3   rU   r   zDiffering files : ['file']r   N
r6   r   r$   r]   r   r   r   r   r   r   r%   r   r   s   &  r   %test_dircmp_no_shallow_different_file8DirCompareTestCase.test_dircmp_no_shallow_different_file"  s    NN488T%:%:EJr*x0$*?*?@(0

 	AHHo6r1   c                X   \         P                  ! V P                  V P                  4      pV P	                  VP
                  R .4       V P	                  VP                  . 4       RP                  V P                  V P                  4      RR.pV P                  VP                  V4       R# )rU   r   r   r   Nr   r   s   &  r   test_dircmp_shallow_same_file0DirCompareTestCase.test_dircmp_shallow_same_file.  s    NN488T%:%:;x0r*$*?*?@(0

 	AHHo6r1   c           
        V P                  \        \        P                  ! R 4      4      ;_uu_ 4        \        P
                  ! V P                  V P                  RRR4       RRR4       V P                  \        P
                  ! V P                  V P                  RRRR7      \        P
                  4       R#   + '       g   i     L_; i)zIdircmp.__init__() takes from 3 to 5 positional arguments but 6 were givenNTr3   )	assertRaisesRegex	TypeErrorreescaper6   r   r$   rZ   assertIsInstancer.   s   &r   #test_dircmp_shallow_is_keyword_only6DirCompareTestCase.test_dircmp_shallow_is_keyword_only:  s    ##IIab
 
 NN488T]]D$E	

 	NN488T]]D$MNN	

 
s   /B99C		c                &    ! R R\         P                  4      pV! V P                  V P                  4      pVP                  pV P                  \        VP                  4       4      R.4       VR,          pV P                  \        V4      V4       R# )z/Check that dircmp.subdirs respects subclassing.c                       ] tR tRtRtR# )=DirCompareTestCase.test_dircmp_subdirs_type.<locals>.MyDirCmpiG   N)rF   rG   rH   rI   rJ   r   r1   r   MyDirCmpr   G  s    r1   r   rT   N)	r6   r   r$   r[   subdirsr   listkeystype)r%   r   r   sub_dirssub_dcmps   &    r   test_dircmp_subdirs_type+DirCompareTestCase.test_dircmp_subdirs_typeE  sj    	w~~ 	TXXt}}-99hmmo.
;H%h2r1   c                   V P                   V P                  r!\        P                  ! W4      p\        P
                  P                  VR 4      p\        P
                  P                  VR 4      pRP                  V P                   V P                  4      RRRRP                  WE4      .pV P                  VP                  V4       R# rT   r   r   r    N)
r$   rZ   r6   r   r,   rX   rY   r   r   report_partial_closurer%   r   r   r   left_subdirright_subdirr   s   &      r   test_report_partial_closure.DirCompareTestCase.test_report_partial_closureO  s    "hh)NN8/ggll8X6ww||Ix8$--8(0:
 	A44oFr1   c                   V P                   V P                  r!\        P                  ! W4      p\        P
                  P                  VR 4      p\        P
                  P                  VR 4      pRP                  V P                   V P                  4      RRRRP                  WE4      .pV P                  VP                  V4       R# r   )
r$   rZ   r6   r   r,   rX   rY   r   r   report_full_closurer   s   &      r   test_report_full_closure+DirCompareTestCase.test_report_full_closure]  s    "hh)NN8/ggll8X6ww||Ix8$--8(0:
 	A11?Cr1   c                   \         P                  ! 4       ;_uu_ 4       pV! 4        VP                  4       P                  4       P	                  R 4      pV P                  WB4       RRR4       R#   + '       g   i     R# ; i)
N)r   captured_stdoutgetvaluestripsplitr   )r%   dircmp_reportexpected_report_linesstdoutreport_liness   &&&  r   r   !DirCompareTestCase._assert_reportk  sU    $$&&&O!??,224::4@L\A '&&&s   AA..A?	)r`   r$   r[   r\   r^   rZ   r]   N)rF   rG   rH   rI   r(   r/   rn   rr   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rJ   rK   rL   s   @r   rO   rO   O   sw     .2b
6>,A,*;A:A72(7V7
7
7	
3GDB Br1   rO   __main__)r6   r,   r   r   r"   unittesttestr   test.supportr   r   TestCaser   rO   rF   mainr   r1   r   <module>r      sg     	 	     "
I5G(++ 5Gn`B** `BF	 zMMO r1   