Skip to content

Commit

Permalink
Update tests with new error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Thushara-Piyasekara committed Apr 10, 2024
1 parent 2c173b0 commit 3e017ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ public void testCreateRawDetails() {
}

@Test(expectedExceptions = BLangTestException.class,
expectedExceptionsMessageRegExp = ".*Invalid update of record field: modification not allowed on readonly " +
"value.*")
expectedExceptionsMessageRegExp = "error: \\{ballerina/lang.map}InherentTypeViolation \\{\"message\":" +
"\"cannot update 'readonly' field 'name' in record of type 'Details & readonly'\".*")
public void testCreateDetails() {

BRunUtil.invoke(result, "testCreateDetails");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function testRecordTypeAnnotationReadonlyValueEdit() {
assertEquality(true, res is error);

error resError = <error> res;
assertEquality("{ballerina/lang.map}InvalidUpdate", resError.message());
assertEquality("Invalid update of record field: modification not allowed on readonly value",
assertEquality("{ballerina/lang.map}InherentTypeViolation", resError.message());
assertEquality("cannot update 'readonly' field 'foo' in record of type 'Annot & readonly'",
resError.detail()["message"]);
}

Expand All @@ -73,8 +73,8 @@ function testAnnotationOnObjectTypeReadonlyValueEdit() {
assertEquality(true, res is error);

error resError = <error> res;
assertEquality("{ballerina/lang.map}InvalidUpdate", resError.message());
assertEquality("Invalid update of record field: modification not allowed on readonly value",
assertEquality("{ballerina/lang.map}InherentTypeViolation", resError.message());
assertEquality("cannot update 'readonly' field 'foo' in record of type 'Annot & readonly'",
resError.detail()["message"]);
}

Expand All @@ -97,8 +97,8 @@ function testAnnotationOnFunctionTypeReadonlyValueEdit() {
assertTrue(res is error);

error resError = <error> res;
assertEquality("{ballerina/lang.map}InvalidUpdate", resError.message());
assertEquality("Invalid update of record field: modification not allowed on readonly value",
assertEquality("{ballerina/lang.map}InherentTypeViolation", resError.message());
assertEquality("cannot update 'readonly' field 'foo' in record of type 'Annot & readonly'",
resError.detail()["message"]);
}

Expand Down

0 comments on commit 3e017ec

Please sign in to comment.