JS: char boxing

This commit is contained in:
Anton Bannykh
2016-12-27 16:11:14 +03:00
parent 55eeb74c08
commit 77aa685496
33 changed files with 438 additions and 59 deletions
@@ -1,3 +1,4 @@
package foo
class Fail(message: String) : Exception(message)
@@ -22,7 +23,7 @@ fun box(): String {
try {
test("arrayOf", arrayOf(0, 1, 2, 3, 4), "0, 1, 2, 3, 4")
test("booleanArrayOf", booleanArrayOf(true, false, false, true, true), "true, false, false, true, true")
test("charArray'", charArrayOf('0', '1', '2', '3', '4'), "'0', '1', '2', '3', '4'")
test("charArray'", charArrayOf('0', '1', '2', '3', '4'), "48, 49, 50, 51, 52")
test("byteArrayOf", byteArrayOf(0, 1, 2, 3, 4), "0, 1, 2, 3, 4")
test("shortArrayOf", shortArrayOf(0, 1, 2, 3, 4), "0, 1, 2, 3, 4")
test("intArray,", intArrayOf(0, 1, 2, 3, 4), "0, 1, 2, 3, 4")
@@ -66,7 +66,7 @@ fun box(): String {
val mapWithCharKeys = HashMap<Char, Int>()
mapWithCharKeys['A'] = 1
assertEquals("string", jsTypeOf (mapWithCharKeys.keys.iterator().next()), "mapWithCharKeys")
assertEquals("object", jsTypeOf (mapWithCharKeys.keys.iterator().next()), "mapWithCharKeys")
val mapWithLongKeys = HashMap<Long, Int>()
mapWithLongKeys[1L] = 1
@@ -52,7 +52,7 @@ fun box(): String {
val charSet = HashSet<Char>()
charSet.add('A')
assertEquals("string", jsTypeOf (charSet.iterator().next()), "charSet")
assertEquals("object", jsTypeOf (charSet.iterator().next()), "charSet")
val longSet = HashSet<Long>()
longSet.add(1L)