-
Notifications
You must be signed in to change notification settings - Fork 17
OC-126: a list of things we need to test #228
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…or switch expressions and switch statements when yield and break are allowed or not
… return values, be void, or throw exceptions
…, returning void or throwing exceptions
…ase matcher, including special cases like 'case null, default'; also a test verifying that mixing different forms of case in a single statement is not allowed
… corrected compilation errors
…ar, first fix was to not treat entire case as a lambda function, but as a simple value, followed by ->, followed by an expression; a second fix was to match a semicolon after an expression; JavaSyntax14CompilationTest correct regexps in switchStatementWithCaseWithColonCanUseBreak (there are extra if-boolean inserted, regex does not match multi-line); ignore switchStatementWithCaseWithColonCannotUseYield as grammar is not so strict
…h the colon-based and the lambda-based switch can be used inside expressions; both the colon-based and the lambda-based can be a standalone statement (in the latter case the lambda-based needs to call void lambdas); using semantic predicates for disambiguation of both formats; returning ContextSetAndComplexity from both types of switches
…e RecorderInstrEmitter generates two helper caseInc() methods
…returning and void expressions are wrapped inside helper caseInc(); throw expressions are converted to blocks with R.inc() before throw
…t single values (JLS specifies it shall be a constant expression, e.g. without method calls, but we're not restricting this); JavaSyntaxCompilationTestBase - change R_CASE_EXPRESSION_RIGHT to simplify asserts; Java14SwitchExpressionWithMultiValueCase - correct test case as it failed on not covering all cases in switch blocks; JavaSyntax14CompilationTest - correct assertions in test cases (mainly placement of space characters)
…anguage specification), they're used in case labels in both forms of the switch expression/statement
…e ternary expressions and since JDK14 also switch expressions in practically every place, a single expression might not have a cyclomatic complexity equal to 0, as somewhere in the expression tree there might be ?: or switch; this non-zero value must be propagated through all possible levels of expressions, even in crazy places like inside array size initializer (see lambdaSwitchExpressionInsideArrayInitializer example), variable declaration, for loop init/condition/iterator, while and do-while conditions, even a throw statement or an expression lambda can have a switch inside
…ase and over a dozen of test classes; add a test of complexityOfTernaryOperator in ExpressionComplexityCounterTest; remove counting ternaryComplexity=1 in conditionalExpression as it's already accounted for in the ExpressionInfo.fromTokens counter
…ts, rewrite and explain test cases
…atements is also calculated properly
… argument lists (as they might have switch expressions, for instance)
…st in constructor calls
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See issue #126.