Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvilla authored and mtdowling committed Apr 5, 2023
1 parent 0ca7e93 commit 89b2aca
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,26 @@ public void detectsMetadataConflicts() {
containsString("Metadata conflict for key `foo`"));
}

@Test
public void metadataIsNotAffectedByTheSourceName() {
Model model1 = new ModelAssembler()
.addUnparsedModel("a1.smithy", "metadata items = [1]")
.addUnparsedModel("a2.smithy", "metadata items = [2]")
.addUnparsedModel("a3.smithy", "metadata items = [3]")
.assemble()
.unwrap();
Model model2 = new ModelAssembler()
.addUnparsedModel("b1.smithy", "metadata items = [1]")
.addUnparsedModel("b2.smithy", "metadata items = [2]")
.addUnparsedModel("b3.smithy", "metadata items = [3]")
.assemble()
.unwrap();
List<Number> metadata1 = model1.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).toList();
List<Number> metadata2 = model2.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).toList();
assertThat(metadata1, is(metadata2));
}


@Test
public void mergesMultipleModels() {
Model model = new ModelAssembler()
Expand Down

0 comments on commit 89b2aca

Please sign in to comment.