We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently this scenario fails with:
Assert.IsTrue failed. expected 'TestState.Sources' to be non-empty
My use case is testing a generator where I only need to supply an additional file. For now, I have to add the following as a workaround:
TestState = { Sources = { string.Empty, } }
The text was updated successfully, but these errors were encountered:
We already allow Sources to be empty if the test includes a generated document:
Sources
roslyn-sdk/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs
Lines 190 to 194 in 5f6ffda
It might be fine to remove this check. I'm not aware of any case where it's caught a test bug.
Sorry, something went wrong.
Ah, I was using the generator testing you done somewhere where there is a #define WRITE_EXPECTED that adds (or writes) the generated code to disk.
#define WRITE_EXPECTED
So, with the first test run there wasn't GeneratedSources. That is probably why I hit this assert.
That's the same way I've hit this assert 😄
No branches or pull requests
Currently this scenario fails with:
My use case is testing a generator where I only need to supply an additional file. For now, I have to add the following as a workaround:
The text was updated successfully, but these errors were encountered: