python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_getopt.cpython-312.opt-1.pyc

ΑegddlmZddlZddlZddlZeZGddejZdZ	dZ
edk(rejyy))EnvironmentVarGuardNcBeZdZdZdZdZdZdZdZdZ	dZ
d	Zy
)GetoptTestscx|jt|_d|jvr|jd=yy)NPOSIXLY_CORRECT)enterContextrenvselfs D/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_getopt.pysetUpzGetoptTests.setUp
s6$$%8%:;(*+)cL|jtjg|i|yN)assertRaisesgetoptGetoptError)rargskwargss   rassertErrorzGetoptTests.assertErrors"&,,>t>v>rc|jtjdd|jtjdd|j	tjddy)Naa:b)
assertTruer
short_has_argassertFalserr
s rtest_short_has_argzGetoptTests.test_short_has_argsN,,S$78--c378--sC8rc>tjddg\}}|j||j|dtjddg\}}|j	||j|dtjddg\}}|j	||j|d|jtjddg|jtjdg|jtjdddgy)Nabcabc=abcddefabcde)r
long_has_argsrassertEqualrr)rhas_argoptions   rtest_long_has_argszGetoptTests.test_long_has_argss ..uvh? ' ..uug>!' ..uvh?!(--uug>--ub9--uvg6FGrctjgddg\}}|j|dg|j|gtjgddg\}}|j|dg|j|gtjgdddg\}}|j|dg|j|gtjgddddg\}}|j|dg|j|dg|jtjgddg|jtjgddgy)Nr-aa1rr,1r02)r	do_shortsr&rroptsrs   rtest_do_shortszGetoptTests.test_do_shorts+s4%%b#sB7
d
|,r"%%b$b9
d}-r"%%b#tcU;
d}-r"%%b#tc3Z@
d}-u%))2tS"=))2sD"=rc"tjgddgg\}}|j|dg|j|gtjgddgg\}}|j|dg|j|gtjgddgg\}}|j|dg|j|gtjgdgdg\}}|j|dg|j|gtjgd	d
dgg\}}|j|dg|j|g|jtjgddgg|jtjgddggy)
Nr )--abcr-zabc=1r!)r7r0zabcd=)z--abcdr0)abr r"zfoo=42zfoo-barzfoo=)z--foo42)rdo_longsr&rr3s   r
test_do_longszGetoptTests.test_do_longsCsm__R<
d
/r"__R6(B?
d/0r"__R7)R@
d01r"__R0ErJ
d
/r"
__RIv3GL
d01r""gwC"efXrBrcgd}tj|dddg\}}|j|gd|j|ddg|jtj|dddgy)	N)r,r0-bz	--alpha=2--betar,3r,r-r>arg1arg2za:bzalpha=beta)r/)r=r-)--alphar1r>r-)r,r?r+rDr@rAalpha)rr&rrcmdliner4rs    rtest_getoptzGetoptTests.test_getopt^sq1]]7EHf3EF
d I	J
	
/0&8IJrcBgd}tj|dddg\}}|j|dg|j|gdtjgddg\}}|j|dg|j|d	d
gtj|dddg\}}|j|d	g|j|gdd
|jd<tj|dddg\}}|j|d	g|j|gdy)N)r,r@r=r0rC--beta=2zab:rEzbeta=r@)r+)r=r0)rCr-)r>r1)r,-r=rKrKr+)r=rKz+ab:)r@r=r0rCrJr0r)r
gnu_getoptr&r	rFs    rtest_gnu_getoptzGetoptTests.test_gnu_getoptos$B&&w7IJ
dx( B	C&&'=ubI
du%
K89&&w'8JK
d
|,IJ'*"#&&w7IJ
d
|,IJrc&tjdgddg\}}|j|dgtjdgddg\}}|j|dg|jtjtjdgddgy)Nz--help=r-zhelp=)--helpr-z--help=x)rOxhelp)rr&rr)rlongopts	shortoptss   rtest_issue4629zGetoptTests.test_issue4629s$mmYKgYG)N#34$mmZL"wiH)O#45&,,fmmi["vhWrN)__name__
__module____qualname__r
rrr)r5r;rHrMrTrrrrs4,
?9
H">0C6K"K4Xrrcy)a~
    Examples from the Library Reference:  Doc/lib/libgetopt.tex

    An example using only Unix style options:


    >>> import getopt
    >>> args = '-a -b -cfoo -d bar a1 a2'.split()
    >>> args
    ['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
    >>> optlist, args = getopt.getopt(args, 'abc:d:')
    >>> optlist
    [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
    >>> args
    ['a1', 'a2']

    Using long option names is equally easy:


    >>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
    >>> args = s.split()
    >>> args
    ['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
    >>> optlist, args = getopt.getopt(args, 'x', [
    ...     'condition=', 'output-file=', 'testing'])
    >>> optlist
    [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')]
    >>> args
    ['a1', 'a2']
    NrXrXrrtest_libref_examplesrZsrcL|jtj|Sr)addTestdoctestDocTestSuite)loadertestspatterns   r
load_testsrbs	MM'&&()Lr__main__)
test.support.os_helperrr]unittestrobjectsentinelTestCaserrZrbrUmainrXrr<module>rjsV7
8BX(##BXH@
zHMMOr