Add sample for emptySet
This commit is contained in:
committed by
Ilya Gorbunov
parent
11696ac4c0
commit
31d650a041
@@ -257,6 +257,22 @@ class Collections {
|
||||
}
|
||||
}
|
||||
|
||||
class Sets {
|
||||
|
||||
@Sample
|
||||
fun emptyReadOnlySet() {
|
||||
val set = setOf<String>()
|
||||
assertTrue(set.isEmpty())
|
||||
|
||||
// another way to create an empty set,
|
||||
// type parameter is inferred from the expected type
|
||||
val other: Set<Int> = emptySet()
|
||||
|
||||
assertTrue(set == other, "Empty sets are equal")
|
||||
assertPrints(set, "[]")
|
||||
}
|
||||
}
|
||||
|
||||
class Transformations {
|
||||
|
||||
@Sample
|
||||
|
||||
Reference in New Issue
Block a user