[Spec tests] Review fix tests for try-expression and if-expression

This commit is contained in:
anastasiia.spaseeva
2019-12-16 17:19:52 +03:00
parent e865327386
commit bd979a12de
21 changed files with 765 additions and 35 deletions
@@ -15,7 +15,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
try {
isTryExecuted = true
} catch (e: Exception) {
@@ -23,7 +22,6 @@ fun box(): String {
} finally {
isFinallyExecuted = true
}
isExecutedFully = true
return if (isTryExecuted && !isCatched && isFinallyExecuted && isExecutedFully) "OK"
return if (isTryExecuted && !isCatched && isFinallyExecuted) "OK"
else "NOK"
}
@@ -16,7 +16,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
try {
isTryExecuted = true
throwException(true)
@@ -25,7 +24,6 @@ fun box(): String {
} finally {
isFinallyExecuted = true
}
isExecutedFully = true
return if (isTryExecuted &&isCatched && isFinallyExecuted && isExecutedFully) "OK"
return if (isTryExecuted &&isCatched && isFinallyExecuted) "OK"
else "NOK"
}
@@ -19,7 +19,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
var isTryExpressionPropagated = false
try {
@@ -35,12 +34,10 @@ fun box(): String {
isTryExpressionPropagated = true
}
isExecutedFully = true
return if (isTryExecuted &&
!isCatched &&
isFinallyExecuted &&
isTryExpressionPropagated &&
isExecutedFully
isTryExpressionPropagated
) "OK"
else "NOK"
}