-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
add regression test for WithDocumentationMode #17803
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,17 @@ private void TestProperty<T>(Func<CSharpParseOptions, T, CSharpParseOptions> fac | |
Assert.Same(newOpt2, newOpt1); | ||
} | ||
|
||
[Fact] | ||
[WorkItem(15358, "https://github.com/dotnet/roslyn/issues/15358")] | ||
public void WithDocumentationModeDoesntChangeFeatures() | ||
{ | ||
var po = new CSharpParseOptions().WithFeatures(new[] { new KeyValuePair<string, string>("IOperation", "true") }); | ||
Assert.Equal(1, po.Features.Count); | ||
var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); | ||
Assert.Equal(1, po2.Features.Count); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should make sure the values match while we're here and adding a test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: extra empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Double blank line |
||
[Fact] | ||
public void WithXxx() | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to assert DocumentationMode before and after. What if the WithDocumentationMode method does nothing? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tested in the next test in the file.