Skip to content

Commit

Permalink
Add initial tests for union types
Browse files Browse the repository at this point in the history
  • Loading branch information
SasinduDilshara committed Aug 25, 2024
1 parent 63f29d4 commit 1bf83d3
Show file tree
Hide file tree
Showing 6 changed files with 664 additions and 41 deletions.
8 changes: 4 additions & 4 deletions ballerina/tests/fromXml_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -3340,13 +3340,13 @@ function testUnsupportedTypeNegative() {
`;
record {|
record {|string a;|}|record {|string b;|} A;
|}|error err2 = parseAsType(xmlVal2);
test:assertEquals((<error>err2).message(), "unsupported input type");
|}|error val = parseAsType(xmlVal2);
test:assertEquals(val, {A: {a: "1"}});

record {|
record {|string a;|}? A;
|}|error err3 = parseAsType(xmlVal2);
test:assertEquals((<error>err3).message(), "unsupported input type");
|}|error val2 = parseAsType(xmlVal2);
test:assertEquals(val2, {A: {a: "1"}});
}

@Namespace {
Expand Down
Loading

0 comments on commit 1bf83d3

Please sign in to comment.