From 487fb883df37380d1ecab440f10cf74c2fc588a7 Mon Sep 17 00:00:00 2001 From: poorna2152 Date: Wed, 25 Oct 2023 11:20:22 +0530 Subject: [PATCH] Update the test with backslash variables --- .../org/ballerinalang/test/identifiers/IdentifierTest.java | 5 +++-- .../test-src/identifiers/identifier_with_escape_char.bal | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/identifiers/IdentifierTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/identifiers/IdentifierTest.java index 20ad1c92e0a8..9d1083d2b133 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/identifiers/IdentifierTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/identifiers/IdentifierTest.java @@ -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); } diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/identifiers/identifier_with_escape_char.bal b/tests/jballerina-unit-test/src/test/resources/test-src/identifiers/identifier_with_escape_char.bal index 1fd038033cad..17322b11e3b8 100644 --- a/tests/jballerina-unit-test/src/test/resources/test-src/identifiers/identifier_with_escape_char.bal +++ b/tests/jballerina-unit-test/src/test/resources/test-src/identifiers/identifier_with_escape_char.bal @@ -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); }