From 4c09af0a77f7bff18f16d7f7a4db0aa066fc287c Mon Sep 17 00:00:00 2001 From: James Strachan Date: Fri, 13 Apr 2012 09:33:29 +0100 Subject: [PATCH] added test case for KT-1773 --- libraries/stdlib/test/MapTest.kt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libraries/stdlib/test/MapTest.kt b/libraries/stdlib/test/MapTest.kt index faea231bfdd..51cbdb7d0e7 100644 --- a/libraries/stdlib/test/MapTest.kt +++ b/libraries/stdlib/test/MapTest.kt @@ -111,4 +111,29 @@ class MapTest { println("Got new map $m2") assertEquals(arrayList("beer2", "Mells2"), m2.values().toList()) } + + + /** + TODO + test case for http://youtrack.jetbrains.com/issue/KT-1773 + */ + + test fun compilerBug() { + val map = TreeMap() + map["beverage"] = "beer" + map["location"] = "Mells" + map["name"] = "James" + + var list = arrayList() + for (e in map) { + println("key = ${e.getKey()}, value = ${e.getValue()}") + list += e.getKey() + list += e.getValue() + } + + assertEquals(6, list.size()) + assertEquals("beverage,beer,location,Mells,name,James", list.makeString(",")) + println("==== worked! $list") + } + }