Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New diff evaluator for added required members #1781

Merged
merged 1 commit into from
May 22, 2023

Conversation

rchache
Copy link
Contributor

@rchache rchache commented May 21, 2023

Issue #, if available:

Description of changes:
Validates that no members are newly created with the required trait (but no default trait) in existing structures.
Emits an event "AddedRequiredMember" for such cases

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchache rchache requested a review from a team as a code owner May 21, 2023 00:46
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").size(), equalTo(1));
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").get(0).getShapeId().get().toString(),
equalTo("smithy.example#A$foo"));
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").get(0).getMessage(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, I think asserting that specific messages is fragile, since improving it causes tests to fail.

@sugmanue sugmanue merged commit fc0cf41 into smithy-lang:main May 22, 2023
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants