Skip to content

Commit

Permalink
Update debugger evaluation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaRanasinghe committed Apr 26, 2024
1 parent 7aebacd commit 4248033
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public abstract class ExpressionEvaluationBaseTest extends BaseTestCase {
protected static final String ANYDATA_VAR = "anydataVar";
protected static final String BYTE_VAR = "byteVar";
protected static final String JSON_VAR = "jsonVar";
protected static final String REGEX_VAR = "regexVar";
protected static final String TABLE_VAR = "tableWithKeyVar";
protected static final String STREAM_VAR = "oddNumberStream";
protected static final String NEVER_VAR = "neverVar";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ public void nameReferenceEvaluationTest() throws BallerinaTestException {
debugTestRunner.assertExpression(context, NEVER_VAR, "XMLSequence (size = 0)", "xml");
// json variable test
debugTestRunner.assertExpression(context, JSON_VAR, "json (size = 3)", "json");
// regex variable test
debugTestRunner.assertExpression(context, REGEX_VAR, "re `[a-zA-Z0-9]`", "regexp");
// anonymous object variable test (AnonPerson object)
debugTestRunner.assertExpression(context, ANON_OBJECT_VAR, "Person_ /<>:@[`{~π_ƮέŞŢ", "object");
// service object variable test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void prepareForEvaluation() throws BallerinaTestException {
String testModuleFileName = "main.bal";
debugTestRunner = new DebugTestRunner(testProjectName, testModuleFileName, true);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 355));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 356));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.RUN);
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(25000);
this.context = debugHitInfo.getRight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected void prepareForEvaluation() throws BallerinaTestException {
String testModuleFileName = "main.bal";
debugTestRunner = new DebugTestRunner(testProjectName, testModuleFileName, true);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 355));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 356));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.RUN);
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(25000);
this.context = debugHitInfo.getRight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void prepareForEvaluation() throws BallerinaTestException {
String testSingleFileName = "evaluation_main.bal";
debugTestRunner = new DebugTestRunner(testProjectName, testSingleFileName, false);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 406));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 407));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.RUN);
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(25000);
this.context = debugHitInfo.getRight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected void prepareForEvaluation() throws BallerinaTestException {
String testSingleFileName = "evaluation_main.bal";
debugTestRunner = new DebugTestRunner(testProjectName, testSingleFileName, false);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 406));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 407));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.RUN);
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(25000);
this.context = debugHitInfo.getRight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public function main() {
byte byteVar = 128;
json jsonVar = {name: "apple", color: "red", price: 40};
xml<never> neverVar = <xml<never>>'xml:concat();
string:RegExp regexVar = re `[a-zA-Z0-9]`;

// quoted identifiers
string '\ \/\:\@\[\`\{\~\u{03C0}_var = "IL with special characters in var";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ public function main() {
byte byteVar = 128;
json jsonVar = {name: "apple", color: "red", price: 40};
xml<never> neverVar = <xml<never>>'xml:concat();
string:RegExp regexVar = re `[a-zA-Z0-9]`;

// quoted identifiers
string '\ \/\:\@\[\`\{\~\u{03C0}_var = "IL with special characters in var";
Expand Down

0 comments on commit 4248033

Please sign in to comment.