-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added 2 tests to check that if conditions inside an else block are be…
…ing parsed correctly.
- Loading branch information
Showing
5 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
2 changes: 1 addition & 1 deletion
2
...liRequestTest/sys_test__if_nested_condition_location_mask_full_cdt_enabled/locations.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"file_path":"src/test/resources/javafile/DummyClassWithIfNestedCdt.java","classPredictions":[{"qualifiedName":"DummyClassWithIf","methodPredictions":[{"startLineNumber":2,"endLineNumber":4,"methodSignature":"meth(int,int)","codePosition":{"startPosition":36,"endPosition":114},"line_predictions":[{"line_number":3,"locations":[{"node":"AND","codePosition":{"startPosition":88,"endPosition":91},"nodeType":"CtBinaryOperatorImpl","firstMutantId":0,"operator":"BinaryOperatorMutator","suffix":""},{"node":"(a \u003c 10) \u0026\u0026 (b \u003e 11)","codePosition":{"startPosition":80,"endPosition":99},"nodeType":"CtBinaryOperatorImpl","firstMutantId":5,"operator":"IfConditionReferenceLocation","suffix":""},{"node":"LT","codePosition":{"startPosition":82,"endPosition":84},"nodeType":"CtBinaryOperatorImpl","firstMutantId":10,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a","codePosition":{"startPosition":81,"endPosition":81},"nodeType":"CtVariableReadImpl","firstMutantId":15,"operator":"LiteralMutator","suffix":""},{"node":"10","codePosition":{"startPosition":85,"endPosition":86},"nodeType":"CtLiteralImpl","firstMutantId":20,"operator":"LiteralMutator","suffix":""},{"node":"GT","codePosition":{"startPosition":94,"endPosition":96},"nodeType":"CtBinaryOperatorImpl","firstMutantId":25,"operator":"BinaryOperatorMutator","suffix":""},{"node":"b","codePosition":{"startPosition":93,"endPosition":93},"nodeType":"CtVariableReadImpl","firstMutantId":30,"operator":"LiteralMutator","suffix":""},{"node":"11","codePosition":{"startPosition":97,"endPosition":98},"nodeType":"CtLiteralImpl","firstMutantId":35,"operator":"LiteralMutator","suffix":""}]}]}]}]}] | ||
[{"file_path":"src/test/resources/javafile/DummyClassWithNestedElseIf.java","classPredictions":[{"qualifiedName":"DummyClassWithElseIf","methodPredictions":[{"startLineNumber":2,"endLineNumber":9,"methodSignature":"meth(int,int)","codePosition":{"startPosition":40,"endPosition":198},"line_predictions":[{"line_number":3,"locations":[{"node":"true","codePosition":{"startPosition":84,"endPosition":87},"nodeType":"CtLiteralImpl","firstMutantId":0,"operator":"LiteralMutator","suffix":""}]},{"line_number":5,"locations":[{"node":"GT","codePosition":{"startPosition":132,"endPosition":134},"nodeType":"CtBinaryOperatorImpl","firstMutantId":5,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a \u003e b","codePosition":{"startPosition":131,"endPosition":135},"nodeType":"CtBinaryOperatorImpl","firstMutantId":10,"operator":"IfConditionReferenceLocation","suffix":""},{"node":"a","codePosition":{"startPosition":131,"endPosition":131},"nodeType":"CtVariableReadImpl","firstMutantId":15,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":135,"endPosition":135},"nodeType":"CtVariableReadImpl","firstMutantId":20,"operator":"LiteralMutator","suffix":""}]},{"line_number":6,"locations":[{"node":"PLUS","codePosition":{"startPosition":164,"endPosition":166},"nodeType":"CtBinaryOperatorImpl","firstMutantId":25,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a","codePosition":{"startPosition":163,"endPosition":163},"nodeType":"CtVariableReadImpl","firstMutantId":30,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":167,"endPosition":167},"nodeType":"CtVariableReadImpl","firstMutantId":35,"operator":"LiteralMutator","suffix":""}]}]}]}]}] |
1 change: 1 addition & 0 deletions
1
...s/expected/CliRequestTest/sys_test__nested_else_if__mask_full_cdt_disabled/locations.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"file_path":"src/test/resources/javafile/DummyClassWithNestedElseIf.java","classPredictions":[{"qualifiedName":"DummyClassWithElseIf","methodPredictions":[{"startLineNumber":2,"endLineNumber":9,"methodSignature":"meth(int,int)","codePosition":{"startPosition":40,"endPosition":198},"line_predictions":[{"line_number":3,"locations":[{"node":"true","codePosition":{"startPosition":84,"endPosition":87},"nodeType":"CtLiteralImpl","firstMutantId":0,"operator":"LiteralMutator","suffix":""}]},{"line_number":5,"locations":[{"node":"GT","codePosition":{"startPosition":132,"endPosition":134},"nodeType":"CtBinaryOperatorImpl","firstMutantId":5,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a","codePosition":{"startPosition":131,"endPosition":131},"nodeType":"CtVariableReadImpl","firstMutantId":10,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":135,"endPosition":135},"nodeType":"CtVariableReadImpl","firstMutantId":15,"operator":"LiteralMutator","suffix":""}]},{"line_number":6,"locations":[{"node":"PLUS","codePosition":{"startPosition":164,"endPosition":166},"nodeType":"CtBinaryOperatorImpl","firstMutantId":20,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a","codePosition":{"startPosition":163,"endPosition":163},"nodeType":"CtVariableReadImpl","firstMutantId":25,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":167,"endPosition":167},"nodeType":"CtVariableReadImpl","firstMutantId":30,"operator":"LiteralMutator","suffix":""}]}]}]}]}] |
1 change: 1 addition & 0 deletions
1
...es/expected/CliRequestTest/sys_test__nested_else_if__mask_full_cdt_enabled/locations.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"file_path":"src/test/resources/javafile/DummyClassWithNestedElseIf.java","classPredictions":[{"qualifiedName":"DummyClassWithElseIf","methodPredictions":[{"startLineNumber":2,"endLineNumber":9,"methodSignature":"meth(int,int)","codePosition":{"startPosition":40,"endPosition":198},"line_predictions":[{"line_number":3,"locations":[{"node":"true","codePosition":{"startPosition":84,"endPosition":87},"nodeType":"CtLiteralImpl","firstMutantId":0,"operator":"LiteralMutator","suffix":""}]},{"line_number":5,"locations":[{"node":"GT","codePosition":{"startPosition":132,"endPosition":134},"nodeType":"CtBinaryOperatorImpl","firstMutantId":5,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a \u003e b","codePosition":{"startPosition":131,"endPosition":135},"nodeType":"CtBinaryOperatorImpl","firstMutantId":10,"operator":"IfConditionReferenceLocation","suffix":""},{"node":"a","codePosition":{"startPosition":131,"endPosition":131},"nodeType":"CtVariableReadImpl","firstMutantId":15,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":135,"endPosition":135},"nodeType":"CtVariableReadImpl","firstMutantId":20,"operator":"LiteralMutator","suffix":""}]},{"line_number":6,"locations":[{"node":"PLUS","codePosition":{"startPosition":164,"endPosition":166},"nodeType":"CtBinaryOperatorImpl","firstMutantId":25,"operator":"BinaryOperatorMutator","suffix":""},{"node":"a","codePosition":{"startPosition":163,"endPosition":163},"nodeType":"CtVariableReadImpl","firstMutantId":30,"operator":"LiteralMutator","suffix":""},{"node":"b","codePosition":{"startPosition":167,"endPosition":167},"nodeType":"CtVariableReadImpl","firstMutantId":35,"operator":"LiteralMutator","suffix":""}]}]}]}]}] |
10 changes: 10 additions & 0 deletions
10
src/test/resources/javafile/DummyClassWithNestedElseIf.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class DummyClassWithElseIf { | ||
public int meth(int a, int b) { | ||
if (true) return a; | ||
else { | ||
if (a > b) { | ||
return a + b; | ||
} | ||
} | ||
} | ||
} |