python (3.12.0)
Αe? d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZm Z m
Z
G d dej Ze G d dej Z
edk( r ej yy) N)TESTFNskip_unless_symlinkcan_symlinkcreate_empty_file
change_cwdc F e Zd ZdZd Zd Zd Zd Zd Zd Z d Z
d Zd
Zd Z
d Zd
Zd Zd Zed Zed Z ej, ej0 dk( d d Zd Zd Z ej, ej0 dk( d d Zd Zd Zd Zd Z d Z!y) GlobTestsNc t j j t j j | j g| S N)ospathnormpathjointempdir)selfpartss B/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_glob.pynormzGlobTests.norm s- wwT\\ BE BCC c | |D cg c], }t j j | j g| . c}S c c}w r )r r
r r )r tuplesr s r joinszGlobTests.joins s, @FGuT\\2E2GGGs 19c | j | }t j j | \ }}t j j | st j
| t
| y r )r r r
splitexistsmakedirsr )r r filenamebasefiles r mktempzGlobTests.mktemp sL 499e$WW]]8,
dww~~d#KK(#r c t dz | _ | j dd | j dd | j dd | j dd | j dd
| j dd | j d
| j d | j ddd | j dddd t rt j
| j
d | j
d t j
d| j
d t j
t j j dd | j
d t j t j ht j k ret j t j v rEt j | j t j t j z | _ y d | _ y )N_diraDaabF.aaG.bbH.JaaazzzFZZZEFbcdefghabrokensym1sym2sym3)r r r r r symlinkr r
r openstatsupports_dir_fdscandirsupports_fdO_RDONLYO_DIRECTORYdir_fdr s r setUpzGlobTests.setUp sQ CE3E3E3E4 E6"EDC%Ct,=JJtyy*DIIf,=>JJx6!23JJrww||C/61BCGGRWW!3!33
bnn8T''$,,bnn0LMDKDKr c | j t j | j t j | j
y r )r? r closeshutilrmtreer r@ s r tearDownzGlobTests.tearDown0 s, ;;"HHT[[!
dll#r c
t | dk( r|d }nt j j | }t j j | j | }t j
|fi |}t j |fi |}| j t j |fi || |D cg c] }t j | }}| j t j
t j | fi || | j t j t j | fi || t | j 5 t j
|fi |}|D ]1 }| j t j j | | 3 |dk( s|dt j z k( r|dd } n|} | j |D cg c], }t j j | j | . c}| | j t j |fi || t j | }
|D cg c] }t j | }}| j t j
|
fi || | j t j |
fi || d d d | j t j
|fd| j i|| | j t j |fd| j i|| t j | j }| j t j
fd|i| | j t j |
fd|i|| | j | j t j
|fd| j i|| | j t j |fd| j i|| | j t j
|
fd| j i|| | j t j |
fd| j i|| |S c c}w c c}w c c}w # 1 sw Y xY w)N r **root_dirr? )lenr r
r r globiglobassertCountEqualfsencoder assertFalseisabssepr? )
r r kwargspatternpresres2xbresexpectedbpatternbres2btempdirs
r rL zGlobTests.glob5 s u:?AhGggllE*GGGLLw/ii$V$zz!&v&djj5f5s;(+,1A,,diiAA&A4HdjjQB6BDI
% I99W//D
6 q!115
6$'TBFF]":qr7!!$"OQ277<<a#@"O"*
,!!$**W"?"?F{{7+H-12R[[^2E2!!$))H"?"?G!!$**X"@"@%H I
diiQ$,,Q&QSWXdjjR4<<R6RTXY;;t||,IIh<<V<e EJJx=(=f=u F ;;"!! '@$++@@$
H!!
7A4;;A&A4
I!! (A4;;A&A5
J!!
8BDKKB6BE
K
M - #P 3 I Is3 1Q(A?Q71Q-
AQ7
Q2)AQ7-
Q77Rc t | }t | }| j t | t | | j t | t | y r )listassertEqualsetsorted)r l1l2s r assertSequencesEqual_noorderz&GlobTests.assertSequencesEqual_noorderg sD
"X
"XR#b'*VBZ0r c V | j } || j d | j d g || j dd | j dd g || j d | j d g || j d g t j d }| j |D ch c]
}t | c}t
h t j t j j t j d }| j |D ch c]
}t | c}t
h t j d }| j |D ch c]
}t | c}t h t j t j j t
j t j d }| j |D ch c]
}t | c}t h y c c}w c c}w c c}w c c}w )Nr# r$ r% zymurgy* *)re rL r r` typestrr r
r curdirbytesrO )r eqrV rs r test_glob_literalzGlobTests.test_glob_literalm sx
.
.
499S>DIIcN+,
499S#3!4 56
499Udii./0
499Y$iin3/a$q'/#7iiRYY453/a$q'/#7iio3/a$q'/%9iiR[[%;TBC3/a$q'/%9 0/ 0/s H2H5H!7H&c F | j t j d g | j t j d g | j t j d| j g | j t j dt j | j g | j t j d| j
g | j t j d| j
g y )N r )rJ )r? )r` rL r r rO r? r@ s r test_glob_empty_patternz!GlobTests.test_glob_empty_pattern~ s 2+3,2=rB3T\\1JKRP2dkk:B?3t{{;R@r c r | j } || j d t | j g d || j d t | j ddg || j d t | j ddg || j d t | j dg || j d
t | j ddg || j d t | j ddg || j d
g y )Nza*)r# r% r, *ar# r, z.*r'