re-enabled the Map.Entry key/value properties (not quite sure why they were disabled, tests all seem to work?) and tidied up the sample code for the kdocs

This commit is contained in:
James Strachan
2012-04-12 14:56:06 +01:00
parent f9b00ad3f9
commit 57a5e81db8
2 changed files with 11 additions and 25 deletions
+5 -16
View File
@@ -52,42 +52,31 @@ class MapTest {
map["location"] = "Mells"
map["name"] = "James"
var list = arrayList<String>()
val list = arrayList<String>()
for (e in map) {
println("key = ${e.getKey()}, value = ${e.getValue()}")
list.add(e.getKey())
list.add(e.getValue())
/*
// TODO compiler bug
list += e.getKey()
list += e.getValue()
*/
}
assertEquals(6, list.size())
assertEquals("beverage,beer,location,Mells,name,James", list.makeString(","))
}
/*
TODO compiler bug
test fun iteratorWithProperties() {
test fun iterateWithProperties() {
val map = TreeMap<String, String>()
map["beverage"] = "beer"
map["location"] = "Mells"
map["name"] = "James"
var list = arrayList<String>()
val list = arrayList<String>()
for (e in map) {
println("got $e")
println("key = ${e.key}, value = ${e.value}")
list += e.key
list += e.value
list.add(e.key)
list.add(e.value)
}
assertEquals(6, list.size())
assertEquals("beverage,beer,location,Mells,name,James", list.makeString(","))
}
*/
}