Fix toFloat in stdlib

This commit is contained in:
Natalia Ukhorskaya
2013-12-04 18:09:20 +04:00
parent cbcca6c08e
commit 6331dd2308
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class ArraysJVMTest {
assertTrue(charArray().isEmpty())
assertFalse(charArray('a').isEmpty())
assertTrue(floatArray().isEmpty())
assertFalse(floatArray(0.1).isEmpty())
assertFalse(floatArray(0.1.toFloat()).isEmpty())
assertTrue(doubleArray().isEmpty())
assertFalse(doubleArray(0.1).isEmpty())
assertTrue(booleanArray().isEmpty())
+1 -1
View File
@@ -155,7 +155,7 @@ class ArraysTest {
expect(50000) { array<Short>(20000, 30000).sum() }
//TODO: uncomment when toLong() will be supported
//expect(3000000000000) { array<Long>(1000000000000, 2000000000000).sum() }
expect(3.0) { array<Float>(1.0, 2.0).sum() }
expect(3.0.toFloat()) { array<Float>(1.0.toFloat(), 2.0.toFloat()).sum() }
}
/*
+1 -1
View File
@@ -479,7 +479,7 @@ class CollectionTest {
expect(14) { arrayListOf(2, 3, 9).sum() }
expect(3.0) { arrayListOf(1.0, 2.0).sum() }
expect(3000000000000) { arrayListOf<Long>(1000000000000, 2000000000000).sum() }
expect(3.0) { arrayListOf<Float>(1.0, 2.0).sum() }
expect(3.0.toFloat()) { arrayListOf<Float>(1.0.toFloat(), 2.0.toFloat()).sum() }
}
class IterableWrapper<T>(collection : Iterable<T>) : Iterable<T> {