Changeset 3442:87f3ddb76a37 in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/04/08 11:55:58 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add a test for duplicate keys in dict constants.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_ul4.py

    r3441 r3442  
    196196    check('1:2\n', '<?for (key, value) in {1:2}.items()?><?print key?>:<?print value?>\n<?end for?>') 
    197197    check('1:2\n', '<?for (key, value) in {1:2,}.items()?><?print key?>:<?print value?>\n<?end for?>') 
     198    # With duplicate keys, later ones simply overwrite earlier ones 
     199    check('1:3\n', '<?for (key, value) in {1:2, 1: 3}.items()?><?print key?>:<?print value?>\n<?end for?>') 
    198200    check('no', '<?if {}?>yes<?else?>no<?end if?>') 
    199201    check('yes', '<?if {1:2}?>yes<?else?>no<?end if?>')