K1/K2: add tests for KT-65441 current behavior
This commit is contained in:
committed by
Space Team
parent
5885514c3d
commit
d870d9dcc6
+25
-1
@@ -1,10 +1,14 @@
|
|||||||
// ISSUE: KT-64640
|
// ISSUE: KT-64640, KT-65441
|
||||||
|
|
||||||
fun bar(x: List<String>) {
|
fun bar(x: List<String>) {
|
||||||
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
|
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
|
||||||
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
|
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
|
||||||
x.<!UNRESOLVED_REFERENCE!>removeFirst<!>()
|
x.<!UNRESOLVED_REFERENCE!>removeFirst<!>()
|
||||||
x.<!UNRESOLVED_REFERENCE!>removeLast<!>()
|
x.<!UNRESOLVED_REFERENCE!>removeLast<!>()
|
||||||
|
x.<!UNRESOLVED_REFERENCE!>getFirst<!>()
|
||||||
|
x.<!UNRESOLVED_REFERENCE!>getLast<!>()
|
||||||
|
x.<!FUNCTION_CALL_EXPECTED!>first<!>
|
||||||
|
x.<!FUNCTION_CALL_EXPECTED!>last<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional test for other SequenceCollection inheritor
|
// Additional test for other SequenceCollection inheritor
|
||||||
@@ -13,11 +17,19 @@ fun baz(x: ArrayDeque<String>, y: LinkedHashSet<String>) {
|
|||||||
x.addLast("")
|
x.addLast("")
|
||||||
x.removeFirst()
|
x.removeFirst()
|
||||||
x.removeLast()
|
x.removeLast()
|
||||||
|
x.<!UNRESOLVED_REFERENCE!>getFirst<!>()
|
||||||
|
x.<!UNRESOLVED_REFERENCE!>getLast<!>()
|
||||||
|
x.<!FUNCTION_CALL_EXPECTED!>first<!>
|
||||||
|
x.<!FUNCTION_CALL_EXPECTED!>last<!>
|
||||||
|
|
||||||
y.addFirst("")
|
y.addFirst("")
|
||||||
y.addLast("")
|
y.addLast("")
|
||||||
y.removeFirst()
|
y.removeFirst()
|
||||||
y.removeLast()
|
y.removeLast()
|
||||||
|
y.getFirst()
|
||||||
|
y.getLast()
|
||||||
|
y.first
|
||||||
|
y.last
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for collections with (add/remove)(First/Last) methods which are not covered by autotests
|
// Test for collections with (add/remove)(First/Last) methods which are not covered by autotests
|
||||||
@@ -26,14 +38,26 @@ fun foo(x: java.util.SequencedCollection<String>, y: java.util.SequencedSet<Stri
|
|||||||
x.addLast("")
|
x.addLast("")
|
||||||
x.removeFirst()
|
x.removeFirst()
|
||||||
x.removeLast()
|
x.removeLast()
|
||||||
|
x.getFirst()
|
||||||
|
x.getLast()
|
||||||
|
x.first
|
||||||
|
x.last
|
||||||
|
|
||||||
y.addFirst("")
|
y.addFirst("")
|
||||||
y.addLast("")
|
y.addLast("")
|
||||||
y.removeFirst()
|
y.removeFirst()
|
||||||
y.removeLast()
|
y.removeLast()
|
||||||
|
y.getFirst()
|
||||||
|
y.getLast()
|
||||||
|
y.first
|
||||||
|
y.last
|
||||||
|
|
||||||
z.addFirst("")
|
z.addFirst("")
|
||||||
z.addLast("")
|
z.addLast("")
|
||||||
z.removeFirst()
|
z.removeFirst()
|
||||||
z.removeLast()
|
z.removeLast()
|
||||||
|
z.getFirst()
|
||||||
|
z.getLast()
|
||||||
|
z.first
|
||||||
|
z.last
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-1
@@ -1,10 +1,14 @@
|
|||||||
// ISSUE: KT-64640
|
// ISSUE: KT-64640, KT-65441
|
||||||
|
|
||||||
fun bar(x: List<String>) {
|
fun bar(x: List<String>) {
|
||||||
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
|
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
|
||||||
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
|
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
|
||||||
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeFirst<!>()
|
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeFirst<!>()
|
||||||
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeLast<!>()
|
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeLast<!>()
|
||||||
|
x.<!DEPRECATION, JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE!>getFirst<!>()
|
||||||
|
x.<!DEPRECATION, JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE!>getLast<!>()
|
||||||
|
x.<!DEPRECATION!>first<!>
|
||||||
|
x.<!DEPRECATION!>last<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional test for other SequenceCollection inheritor
|
// Additional test for other SequenceCollection inheritor
|
||||||
@@ -13,11 +17,19 @@ fun baz(x: ArrayDeque<String>, y: LinkedHashSet<String>) {
|
|||||||
x.addLast("")
|
x.addLast("")
|
||||||
x.removeFirst()
|
x.removeFirst()
|
||||||
x.removeLast()
|
x.removeLast()
|
||||||
|
x.<!DEPRECATION!>getFirst<!>()
|
||||||
|
x.<!DEPRECATION!>getLast<!>()
|
||||||
|
x.<!DEPRECATION!>first<!>
|
||||||
|
x.<!DEPRECATION!>last<!>
|
||||||
|
|
||||||
y.addFirst("")
|
y.addFirst("")
|
||||||
y.addLast("")
|
y.addLast("")
|
||||||
y.removeFirst()
|
y.removeFirst()
|
||||||
y.removeLast()
|
y.removeLast()
|
||||||
|
y.getFirst()
|
||||||
|
y.getLast()
|
||||||
|
y.first
|
||||||
|
y.last
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for collections with (add/remove)(First/Last) methods which are not covered by autotests
|
// Test for collections with (add/remove)(First/Last) methods which are not covered by autotests
|
||||||
@@ -26,14 +38,26 @@ fun foo(x: java.util.SequencedCollection<String>, y: java.util.SequencedSet<Stri
|
|||||||
x.addLast("")
|
x.addLast("")
|
||||||
x.removeFirst()
|
x.removeFirst()
|
||||||
x.removeLast()
|
x.removeLast()
|
||||||
|
x.getFirst()
|
||||||
|
x.getLast()
|
||||||
|
x.first
|
||||||
|
x.last
|
||||||
|
|
||||||
y.addFirst("")
|
y.addFirst("")
|
||||||
y.addLast("")
|
y.addLast("")
|
||||||
y.removeFirst()
|
y.removeFirst()
|
||||||
y.removeLast()
|
y.removeLast()
|
||||||
|
y.getFirst()
|
||||||
|
y.getLast()
|
||||||
|
y.first
|
||||||
|
y.last
|
||||||
|
|
||||||
z.addFirst("")
|
z.addFirst("")
|
||||||
z.addLast("")
|
z.addLast("")
|
||||||
z.removeFirst()
|
z.removeFirst()
|
||||||
z.removeLast()
|
z.removeLast()
|
||||||
|
z.getFirst()
|
||||||
|
z.getLast()
|
||||||
|
z.first
|
||||||
|
z.last
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user