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

Simplify tests #75977

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Simplify tests #75977

merged 2 commits into from
Nov 22, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 19, 2024 20:07
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 19, 2024
Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -51,6 +51,7 @@ static Test()
public Test()
{
_sharedState = new SharedVerifierState(this, DefaultFileExt);
this.FixedState.InheritanceMode = StateInheritanceMode.AutoInherit;
Copy link
Member

Choose a reason for hiding this comment

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

I am highly concerned about this significantly changing the test behavior in ways that cannot be explained.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the significant change in test behavior.

that cannot be explained.

Who can explain it? Isn't this the behavior of normal CodeFix Tests? They inherit the end state from the start state? Which is why you don't need to supply the 'FixedCode' if it is the same as the 'TestCode'.

@CyrusNajmabadi
Copy link
Member Author

Going to mvoe forward on this, esp. as it mirrors how code fixes already work, unless tehre is a demonstrable problem here. Being able to just supply TestCode, and nothing else, to indicate ethat nothing changes is much nicer. It also allows the test to just be a single declarative expression, instead of needing to define locals which are passed multiple times to the .Test constructor. This is the form we use everywhere for code-fixes, so having parity with refactorings is good.

I'll wait till tomorrow and merge then if there's no additional information added.

@CyrusNajmabadi CyrusNajmabadi merged commit 45e24db into dotnet:main Nov 22, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the simplifyTests branch November 22, 2024 01:54
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants