Skip to content

Commit

Permalink
Sync release-1.2.46 with 1.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanWeerasinghe committed Nov 6, 2023
1 parent f914e44 commit 452ff43
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.workers.max=3
version=1.2.46
version=1.2.47
group=org.ballerinalang
bootstrappedOn=1.1.0-alpha
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ target = "java8"
[[platform.libraries]]
artifactId = "mock"
version = "0.0.0"
path = "./lib/testerina-core-1.2.45.jar"
path = "./lib/testerina-core-1.2.46.jar"
groupId = "ballerina"
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.ballerinalang.test.sandbox;

import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BValue;
import org.ballerinalang.test.BCompileUtil;
import org.ballerinalang.test.BRunUtil;
import org.ballerinalang.test.CompileResult;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.Arrays;

/**
* Dummy test
*/
public class DummyTest {

private CompileResult result;

@BeforeClass
public void setup() {
this.result = BCompileUtil.compile("test-src/sandbox/dummy.bal");
Assert.assertEquals(result.getErrorCount(), 0, Arrays.asList(result.getDiagnostics()).toString());
}

@Test
public void sandboxtest() {
BRunUtil.invoke(result, "main");
}

@AfterClass
public void tearDown() {
result = null;
}

public static void print(Object value) {
System.out.println("############################");
System.out.println(StringUtils.getStringValue(value, null));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public function main() {
from var i in 1 ... 4
do {
int a = i;

from var j in 1 ... 4
do {
int b = j + i;
};

int c = i;
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

// int index = 0;


public function main() {
// int index = 0;
_ = from var i in [1, 2, 3, 4]
do {
int index = 0;

from var j in [3, 4, 5]
do {
int newIndex = index + j;
};
// int a = index;
};
}

0 comments on commit 452ff43

Please sign in to comment.