[Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.25,1.26 test_new.py,1.8,1.9

Jeremy Hylton jhylton@users.sourceforge.net
Thu, 25 Jan 2001 12:12:29 -0800


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

Modified Files:
	test_grammar.py test_new.py 
Log Message:
PEP 227 implementation

test_new: new.code() noew takes two more arguments
test_grammer: Add a bunch of test cases for lambda (not really PEP 227 related)



Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** test_grammar.py	2001/01/25 17:03:37	1.25
--- test_grammar.py	2001/01/25 20:12:27	1.26
***************
*** 247,250 ****
--- 247,264 ----
  d22v(1, *(2, 3), **{'d': 4})
  
+ ### lambdef: 'lambda' [varargslist] ':' test
+ print 'lambdef'
+ l1 = lambda : 0
+ verify(l1() == 0)
+ l2 = lambda : a[d] # XXX just testing the expression
+ l3 = lambda : [2 < x for x in [-1, 3, 0L]]
+ verify(l3() == [0, 1, 0])
+ l4 = lambda x = lambda y = lambda z=1 : z : y() : x()
+ verify(l4() == 1)
+ l5 = lambda x, y, z=2: x + y + z
+ verify(l5(1, 2) == 5)
+ verify(l5(1, 2, 3) == 6)
+ check_syntax("lambda x: x = 2")
+ 
  ### stmt: simple_stmt | compound_stmt
  # Tested below

Index: test_new.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_new.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** test_new.py	2001/01/17 21:51:35	1.8
--- test_new.py	2001/01/25 20:12:27	1.9
***************
*** 59,63 ****
  # bogus test of new.code()
  print 'new.code()'
! d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>", 1, "")
  if verbose:
      print d
--- 59,64 ----
  # bogus test of new.code()
  print 'new.code()'
! d = new.code(3, 3, 3, 3, codestr, (), (), (), (), (),
!              "<string>", "<name>", 1, "")
  if verbose:
      print d