added an attempt to use the standard APIs on kotlin.Iterable

This commit is contained in:
James Strachan
2012-01-05 12:15:27 +00:00
parent ac276e08ba
commit 89933439f4
2 changed files with 21 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
package test.collections
import std.*
import std.test.*
class StandardCollectionTest() : TestSupport() {
fun testAny() {
// TODO is a cast really required?
// doesn't compile without it, see KT-924
val data: Iterable<String> = std.util.arrayList("foo", "bar") as Iterable<String>
assert {
data.any{it.startsWith("f")}
}
assertNot {
data.any{it.startsWith("x")}
}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ import junit.framework.TestSuite;
*/
public class TestAll {
public static TestSuite suite() {
TestSuite suite = new TestSuite(CollectionTest.class, IoTest.class, ListTest.class, MapTest.class, SetTest.class, OldStdlibTest.class);
TestSuite suite = new TestSuite(StandardCollectionTest.class, CollectionTest.class, IoTest.class, ListTest.class, MapTest.class, SetTest.class, OldStdlibTest.class);
suite.addTest(testDslExample.namespace.getSuite());
return suite;
}