Skip to content

Commit

Permalink
Test CDATA for metadata-as-source
Browse files Browse the repository at this point in the history
Add test case for dotnet#22431
  • Loading branch information
Youssef1313 authored May 4, 2021
1 parent af7109e commit c63fa8a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/EditorFeatures/Test/MetadataAsSource/MetadataAsSourceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3087,5 +3087,35 @@ public class TestType
var metadataAsSourceFile = await context.GenerateSourceAsync(navigationSymbol);
TestContext.VerifyResult(metadataAsSourceFile, expected);
}

[WorkItem(22431, "https://github.com/dotnet/roslyn/issues/22431")]
[Fact, Trait(Traits.Feature, Traits.Features.MetadataAsSource)]
public async Task TestCDATAComment()
{
var source = @"
public enum BinaryOperatorKind
{
/// <summary>
/// Represents the <![CDATA['<<']]> operator.
/// </summary>
LeftShift = 0x8,
}
";
var symbolName = "BinaryOperatorKind.LeftShift";
var expectedCS = $@"#region {FeaturesResources.Assembly} ReferencedAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// {CodeAnalysisResources.InMemoryAssembly}
#endregion
using System;
public enum BinaryOperatorKind
{{
//
// {FeaturesResources.Summary_colon}
// Represents the << operator.
LeftShift = 0x8,
}}";
await GenerateAndVerifySourceAsync(source, symbolName, LanguageNames.CSharp, expectedCS, includeXmlDocComments: true);
}
}
}

0 comments on commit c63fa8a

Please sign in to comment.