提交 15c46c05 编写于 作者: H Heejae Chang

add unit test for Temporary Storage preserving SourceText Encoding

上级 0de03569
......@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Host;
......@@ -323,5 +324,24 @@ public void StreamTest3()
}
}
}
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/353"), Trait(Traits.Feature, Traits.Features.Workspace)]
public void TestTemporaryStorageTextEncoding()
{
var textFactory = new TextFactoryService();
var service = new TemporaryStorageServiceFactory.TemporaryStorageService(textFactory);
// test normal string
var text = SourceText.From(new string(' ', 4096) + "public class A {}", Encoding.ASCII);
TestTemporaryStorage(service, text);
// test empty string
text = SourceText.From(string.Empty);
TestTemporaryStorage(service, text);
// test large string
text = SourceText.From(new string(' ', 1024 * 1024) + "public class A {}");
TestTemporaryStorage(service, text);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册