From 5aa3b8a6967575de1251df136fb1cebcd60c8ee9 Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:17:42 +0530 Subject: [PATCH] Fix test failures in windows --- ballerina/Dependencies.toml | 13 ------------- .../resources/default_namespaced_invoice.xml | 8 ++------ ballerina/tests/stream_default_namspace_test.bal | 16 ++++------------ ballerina/tests/stream_namespace_test.bal | 7 ++----- 4 files changed, 8 insertions(+), 36 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 4142d61..eb35607 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -14,7 +14,6 @@ version = "0.1.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "test"} ] modules = [ @@ -51,18 +50,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] -[[package]] -org = "ballerina" -name = "lang.regexp" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "lang.regexp", moduleName = "lang.regexp"} -] - [[package]] org = "ballerina" name = "lang.value" diff --git a/ballerina/tests/resources/default_namespaced_invoice.xml b/ballerina/tests/resources/default_namespaced_invoice.xml index 62e237f..86f0bc6 100644 --- a/ballerina/tests/resources/default_namespaced_invoice.xml +++ b/ballerina/tests/resources/default_namespaced_invoice.xml @@ -1,16 +1,12 @@ - This is the description for - Product 1. - + This is the description for Product 1. 57.70 Home and Garden - This is the description for - Product 2. - + This is the description for Product 2. 6312.36 Books diff --git a/ballerina/tests/stream_default_namspace_test.bal b/ballerina/tests/stream_default_namspace_test.bal index ec0c9f2..cae4b4f 100644 --- a/ballerina/tests/stream_default_namspace_test.bal +++ b/ballerina/tests/stream_default_namspace_test.bal @@ -128,9 +128,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -139,9 +137,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); @@ -228,9 +224,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, string `This is the description for Product 1.`); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -239,9 +233,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, string `This is the description for Product 2.`); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/ballerina/tests/stream_namespace_test.bal b/ballerina/tests/stream_namespace_test.bal index dc514f2..54336fd 100644 --- a/ballerina/tests/stream_namespace_test.bal +++ b/ballerina/tests/stream_namespace_test.bal @@ -16,7 +16,6 @@ import ballerina/io; import ballerina/test; -import ballerina/lang.regexp; @Namespace { uri: "http://www.example.com/products", @@ -200,8 +199,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(regexp:replaceAll(re `\r`, invoice.products.product[0].description, ""), - "This is the description for\n Product 1.\n "); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -210,8 +208,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(regexp:replaceAll(re `\r`, invoice.products.product[1].description, ""), - "This is the description for\n Product 2.\n "); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR");