Skip to content

Commit

Permalink
Update the test with backslash variables
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Nov 22, 2023
1 parent b7458c8 commit 487fb88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ public void testInvalidImportOnMultipleFiles() {
public void testEscapedIdentifier() {
CompileResult result = BCompileUtil.compile("test-src/identifiers/identifier_with_escape_char.bal");
int index = 0;
validateError(result, index++, "redeclared symbol 'a3'", 19, 9);
validateError(result, index++, "redeclared symbol 'student-performance'", 21, 9);
validateError(result, index++, "redeclared symbol 'a3'", 20, 9);
validateError(result, index++, "redeclared symbol 'student-performance'", 22, 9);
validateError(result, index++, "redeclared symbol 'resource\\1path'", 24, 12);
assertEquals(result.getErrorCount(), index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import ballerina/io;

public function foo() {
int a\3 = 0;
int a3 = 2;
int student\-performance = 3;
int student\u{002D}performance = 2;
string resource\\1path = "https:\\";
string resource\u{005c}1path = "http";
io:println(resource\\1path);
}

0 comments on commit 487fb88

Please sign in to comment.