[Python-checkins] CVS: python/dist/src/Lib/test test_getopt.py,1.2,1.3

Tim Peters python-dev@python.org
Wed, 27 Dec 2000 00:03:22 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv715/python/dist/src/lib/test

Modified Files:
	test_getopt.py 
Log Message:
Add test case for SF bug
https://sourceforge.net/bugs/?func=detailbug&bug_id=126863&group_id=5470


Index: test_getopt.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_getopt.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_getopt.py	2000/08/21 22:59:26	1.2
--- test_getopt.py	2000/12/27 08:03:20	1.3
***************
*** 75,78 ****
--- 75,87 ----
  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)