[FIR-TEST] Update testdata of old FE contracts tests
This commit is contained in:
+9
-9
@@ -13,7 +13,7 @@ fun myAssert(condition: Boolean) {
|
||||
|
||||
fun testAssertSmartcast(x: Any?) {
|
||||
myAssert(x is String)
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
|
||||
fun testInvertedAssert(x: Any?) {
|
||||
@@ -24,34 +24,34 @@ fun testInvertedAssert(x: Any?) {
|
||||
fun testSpilling(x: Any?) {
|
||||
if (x != null) {
|
||||
myAssert(x is String)
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
}
|
||||
|
||||
fun testAssertInIf(x: Any?) {
|
||||
if (myAssert(x is String) == Unit) {
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
else {
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
}
|
||||
|
||||
fun testTryCatch(x: Any?) {
|
||||
try {
|
||||
myAssert(x is String)
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
} catch (e: kotlin.IllegalArgumentException) {
|
||||
|
||||
}
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
|
||||
fun testUncertainFlow(x: Any?) {
|
||||
repeat(x.toString().length) {
|
||||
myAssert(x is String)
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
}
|
||||
@@ -59,8 +59,8 @@ fun testUncertainFlow(x: Any?) {
|
||||
fun testAtLeastOnceFlow(x: Any?) {
|
||||
do {
|
||||
myAssert(x is String)
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
} while (x != null)
|
||||
|
||||
x.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
x.length
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user