Moved VB tests to test emitted attributes vs source synthesized ones#25032
Moved VB tests to test emitted attributes vs source synthesized ones#25032OmarTawfik merged 2 commits intodotnet:masterfrom OmarTawfik:fix-vb-attr-tests
Conversation
|
cc @dotnet/roslyn-compiler #Closed |
|
@dotnet/roslyn-compiler any reviewers? this is a test-only change. #Closed |
|
@dotnet/roslyn-compiler for review. #Closed |
Consider adding a helper method which converts all members of an enum to a Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:37 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Glad we're making better use of Theory's i the code. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:136 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Next time prefer doing the theory conversion as a separate commit. Makse the other changes easier to review. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:59 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Consider using a helper to extract the constructor value as an enum. That would avoid the new casts and possible remove duplicate code. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:112 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Before there was an implicit assertion that the attribute was a part of the System.CompilerServices namespace. It seems we lost that in the new code. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:573 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Before there was an implicit assertion of the full name of the attribute. Seems we've lost that here. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:631 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Is there an equivalent to this assert in the new code? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:709 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Is there an equivalent to this assert in the new code? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:754 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Why did the code move from having 2 attributes to 3? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:799 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Why was this removed? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:789 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Shouldn't this be indented one level? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:923 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
There used to be an implicit assert about the full name of this type that we've lost in the new code. #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:937 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
Why were these methods removed? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:941 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Assert.Empty? #Resolved Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:982 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
|
done with review pass 1 #Resolved |
CompileAndVerify() will fail if there are any errors In reply to: 384106614 [](ancestors = 384106614) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:709 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
CompileAndVerify() will fail if there are any errors In reply to: 384107229 [](ancestors = 384107229) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:754 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Replaced by the In reply to: 384108356 [](ancestors = 384108356) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:941 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
error BC30549: Attribute 'RuntimeCompatibilityAttribute' cannot be applied to a module. In reply to: 384107586 [](ancestors = 384107586) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:789 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = True) |
Because this is testing the compiled assembly. The compiler also adds In reply to: 384107428 [](ancestors = 384107428) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:799 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
I'd prefer to keep this direct. The pattern is straightforward and short enough? In reply to: 384095345 [](ancestors = 384095345) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:37 in 4fc6afa. [](commit_id = 4fc6afa1484a4c9857aecb0044d7861594a69e54, deletion_comment = False) |
|
@jaredpar comments addressed. |
At the least I think this could benefit from having an API that returned a typed collection of Enum values from an enum. In reply to: 387245899 [](ancestors = 387245899,384095345) Refers to: src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Synthesized.vb:37 in 6788668. [](commit_id = 6788668, deletion_comment = False) |
|
@dotnet-bot test windows_debug_unit64_prtest |
|
@jaredpar for ask mode approval. |
|
approved |
|
Note: this is test only hence it doesn't need ask mode approval. |
Closes #18799