Skip to content

Commit ba1579b

Browse files
committed
add test
1 parent 481d43e commit ba1579b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/run/named-tuple-ops.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ type Labels = (x: String, y: String)
8282
val _: List[String | Int] = cityFields
8383
assert(cityFields == List("Lausanne", 1000, 140000))
8484

85-
val citArr = city.toArray
86-
val _: List[String | Int] = cityFields
87-
assert(cityFields == List("Lausanne", 1000, 140000))
85+
val cityArr = city.toArray
86+
val _: Array[Object] = cityArr
87+
assert(cityArr.sameElements(Array("Lausanne", 1000, 140000)))
8888

89+
val cityMap = city.toMap
90+
val _: Map[String, String | Int] = cityMap
91+
assert(cityMap == Map("name" -> "Lausanne", "zip" -> 1000, "pop" -> 140000))

0 commit comments

Comments
 (0)