Fix toFloat in stdlib
This commit is contained in:
@@ -71,7 +71,7 @@ class ArraysJVMTest {
|
|||||||
assertTrue(charArray().isEmpty())
|
assertTrue(charArray().isEmpty())
|
||||||
assertFalse(charArray('a').isEmpty())
|
assertFalse(charArray('a').isEmpty())
|
||||||
assertTrue(floatArray().isEmpty())
|
assertTrue(floatArray().isEmpty())
|
||||||
assertFalse(floatArray(0.1).isEmpty())
|
assertFalse(floatArray(0.1.toFloat()).isEmpty())
|
||||||
assertTrue(doubleArray().isEmpty())
|
assertTrue(doubleArray().isEmpty())
|
||||||
assertFalse(doubleArray(0.1).isEmpty())
|
assertFalse(doubleArray(0.1).isEmpty())
|
||||||
assertTrue(booleanArray().isEmpty())
|
assertTrue(booleanArray().isEmpty())
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class ArraysTest {
|
|||||||
expect(50000) { array<Short>(20000, 30000).sum() }
|
expect(50000) { array<Short>(20000, 30000).sum() }
|
||||||
//TODO: uncomment when toLong() will be supported
|
//TODO: uncomment when toLong() will be supported
|
||||||
//expect(3000000000000) { array<Long>(1000000000000, 2000000000000).sum() }
|
//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() }
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ class CollectionTest {
|
|||||||
expect(14) { arrayListOf(2, 3, 9).sum() }
|
expect(14) { arrayListOf(2, 3, 9).sum() }
|
||||||
expect(3.0) { arrayListOf(1.0, 2.0).sum() }
|
expect(3.0) { arrayListOf(1.0, 2.0).sum() }
|
||||||
expect(3000000000000) { arrayListOf<Long>(1000000000000, 2000000000000).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> {
|
class IterableWrapper<T>(collection : Iterable<T>) : Iterable<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user