# Test inference of DictionaryEntry from Hashtable enumerator use System.Collections class HashtableBug def main .testHashtableEnumerator .testKeyValueUnpack def testHashtableEnumerator ht = Hashtable() ht['a'] = 'value1' ht['b'] = 'value2' ht['c'] = 'value3' for de in ht assert de.typeOf == System.Collections.DictionaryEntry #print de.key, de.value assert de.key to dynamic in ['a', 'b', 'c'] assert de.value to dynamic in ['value1', 'value2', 'value3'] ht1 = Hashtable() ht1['x'] = 'Xvalue1' ht1['y'] = 'Xvalue2' ht1['z'] = 'Xvalue3' for de1 in ht1 assert de1.key to dynamic in ['x', 'y', 'z'] assert de1.value to dynamic in ['Xvalue1', 'Xvalue2', 'Xvalue3'] for de in ht1 assert de.key to dynamic in ['x', 'y', 'z'] assert de.value to dynamic in ['Xvalue1', 'Xvalue2', 'Xvalue3'] def testKeyValueUnpack ht = Hashtable() ht['a'] = 'value1' ht['b'] = 'value2' ht['c'] = 'value3' for k, v in ht assert k to dynamic in ['a', 'b', 'c'] assert v to dynamic in ['value1', 'value2', 'value3']