]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add simple section for assert, including assert w/ lambdas
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 19 Feb 2001 15:54:52 +0000 (15:54 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 19 Feb 2001 15:54:52 +0000 (15:54 +0000)
Lib/test/output/test_grammar
Lib/test/test_grammar.py

index 70d88365497b043abdae2c8fc8d0699674c53a95..927b4feb94477a29eb543c24ae41a64056379336 100644 (file)
@@ -37,6 +37,7 @@ raise_stmt
 import_stmt
 global_stmt
 exec_stmt
+assert_stmt
 if_stmt
 while_stmt
 for_stmt
index 781f373bb1054909e4e49d29b476f69aed2df8c3..587d7ecfcf47763416439c680e053935b29a32cb 100644 (file)
@@ -417,6 +417,12 @@ if l.has_key('__builtins__'): del l['__builtins__']
 if (g, l) != ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g (%s), l (%s)' %(g,l)
 
 
+print "assert_stmt" # assert_stmt: 'assert' test [',' test]
+assert 1
+assert 1, 1
+assert lambda x:x
+assert 1, lambda x:x+1
+
 ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
 # Tested below