-
Notifications
You must be signed in to change notification settings - Fork 24
Input arrays support #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Input arrays support #285
Conversation
invariants = invariants, | ||
extractValuesToCheck = { r -> r.before.parameters + r.returnValue }, | ||
expectedTypesForExtractedValues = arrayOf( | ||
typeTransformer(T1::class), typeTransformer(T2::class), typeTransformer(R::class) |
Check warning
Code scanning / detekt
Reports incorrect argument list wrapping Warning test
invariants = invariants, | ||
extractValuesToCheck = { r -> r.before.parameters + r.returnValue }, | ||
expectedTypesForExtractedValues = arrayOf( | ||
typeTransformer(T1::class), typeTransformer(T2::class), typeTransformer(R::class) |
Check warning
Code scanning / detekt
Reports incorrect argument list wrapping Warning test
@@ -139,6 +199,30 @@ | |||
) | |||
} | |||
|
|||
protected inline fun <reified T1 : TsTestValue, reified T2 : TsTestValue, reified T3 : TsTestValue, reified R : TsTestValue> checkMatches( |
Check warning
Code scanning / detekt
Reports lines with exceeded length Warning test
@@ -139,6 +199,30 @@ | |||
) | |||
} | |||
|
|||
protected inline fun <reified T1 : TsTestValue, reified T2 : TsTestValue, reified T3 : TsTestValue, reified R : TsTestValue> checkMatches( |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning test
@@ -163,6 +247,31 @@ | |||
) | |||
} | |||
|
|||
protected inline fun <reified T1 : TsTestValue, reified T2 : TsTestValue, reified T3 : TsTestValue, reified T4 : TsTestValue, reified R : TsTestValue> checkMatches( |
Check warning
Code scanning / detekt
Reports lines with exceeded length Warning test
@@ -163,6 +247,31 @@ | |||
) | |||
} | |||
|
|||
protected inline fun <reified T1 : TsTestValue, reified T2 : TsTestValue, reified T3 : TsTestValue, reified T4 : TsTestValue, reified R : TsTestValue> checkMatches( |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning test
@@ -20,6 +20,11 @@ | |||
matcherFailedMessage = { _ -> "No analysis results received" } | |||
) { it > 0 } | |||
|
|||
val noResultsExpected = AnalysisResultsNumberMatcher( | |||
description = "No executions expected", | |||
matcherFailedMessage = { it -> "Expected no analysis results, but $it executions were found" } |
Check warning
Code scanning / detekt
Declaring lambda parameters as `it` is redundant. Warning test
ac893b9
to
163e637
Compare
) | ||
|
||
// If we want to get length from a fake object, we assume that it is an array. | ||
scope.assert(fakeType.refTypeExpr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why assert
and not pathConstraints += ...
?
@@ -809,7 +901,12 @@ class TsExprResolver( | |||
blockOnFalseState = allocateException(EtsStringType) // TODO incorrect exception type | |||
) | |||
|
|||
val arrayType = EtsArrayType(EtsUnknownType, 1) // TODO: expr.type | |||
val arrayType = expr.type as EtsArrayType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cast might fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid 🪨
@@ -76,6 +87,33 @@ | |||
return TsTest(method, before, after, result, trace = emptyList()) | |||
} | |||
|
|||
private fun prepareForResolve(state: TsState) { | |||
state.lValuesToAllocatedFakeObjects.forEach { (lValue, fakeObject) -> | |||
when (lValue) { |
Check warning
Code scanning / detekt
Braces do not comply with the specified policy Warning test
The following changes were made: