mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Add test case for SF bug
https://sourceforge.net/bugs/?func=detailbug&bug_id=126863&group_id=5470
This commit is contained in:
parent
be0630282e
commit
da7bf4e236
1 changed files with 9 additions and 0 deletions
|
|
@ -74,6 +74,15 @@ assert args == []
|
|||
opts, args = getopt.do_longs([], 'abc=1', ['abcd='], [])
|
||||
assert opts == [('--abcd', '1')]
|
||||
assert args == []
|
||||
opts, args = getopt.do_longs([], 'abc', ['ab', 'abc', 'abcd'], [])
|
||||
assert opts == [('--abc', '')]
|
||||
assert args == []
|
||||
# Much like the preceding, except with a non-alpha character ("-") in
|
||||
# option name that precedes "="; failed in
|
||||
# http://sourceforge.net/bugs/?func=detailbug&bug_id=126863&group_id=5470
|
||||
opts, args = getopt.do_longs([], 'foo=42', ['foo-bar', 'foo=',], [])
|
||||
assert opts == [('--foo', '42')]
|
||||
assert args == []
|
||||
expectException("opts, args = getopt.do_longs([], 'abc=1', ['abc'], [])",
|
||||
GetoptError)
|
||||
expectException("opts, args = getopt.do_longs([], 'abc', ['abc='], [])",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue