Protection against "<caret>" missing in test data

Many incorrect tests fixed
This commit is contained in:
Valentin Kipyatkov
2016-09-21 22:08:19 +03:00
parent be8b31e82b
commit 21c2268f70
29 changed files with 52 additions and 27 deletions
@@ -1,4 +1,12 @@
// "Create function" "false"
// ACTION: Create extension function 'Collection<List<String>>.firstOrNull'
// ACTION: Create extension function 'Unit.equals'
// ACTION: Create local variable 'maximumSizeOfGroup'
// ACTION: Create object 'maximumSizeOfGroup'
// ACTION: Create parameter 'maximumSizeOfGroup'
// ACTION: Create property 'maximumSizeOfGroup'
// ACTION: Introduce local variable
// ACTION: Rename reference
// ERROR: A 'return' expression required in a function with a block body ('{...}')
// ERROR: The expression cannot be a selector (occur after a dot)
// ERROR: Type inference failed: inline fun <T> Iterable<T>.firstOrNull(predicate: (T) -> Boolean): T?<br>cannot be applied to<br>receiver: Collection<List<String>> arguments: ((List<String>) -> () -> Boolean)<br>
@@ -9,5 +17,5 @@ fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection
val groupsByLength = collection.groupBy { s -> { s.length } }
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
return groupsByLength.values.firstOrNull { group -> {group.size == maximumSizeOfGroup} }
return groupsByLength.values.firstOrNull { group -> {group.size == <caret>maximumSizeOfGroup} }
}