Add fallback for netstandard2.0

This commit is contained in:
Tatsunori Uchino
2026-03-01 19:29:31 +09:00
parent f9aa8e1e8d
commit 7400a7bb0b

View File

@@ -110,12 +110,20 @@ class Program
continue;
}
string source = ParseSpecification(spec, File.ReadAllText(spec.Path)).Replace("\r\n", "\n", StringComparison.Ordinal);
string source = ParseSpecification(spec, File.ReadAllText(spec.Path)).Replace("\r\n", "\n"
#if false
, StringComparison.Ordinal
#endif
);
totalTests += spec.TestCount;
if (File.Exists(spec.OutputPath)) // If the source hasn't changed, don't bump the generated tag
{
string previousSource = File.ReadAllText(spec.OutputPath).Replace("\r\n", "\n", StringComparison.Ordinal);
string previousSource = File.ReadAllText(spec.OutputPath).Replace("\r\n", "\n"
#if NET
, StringComparison.Ordinal
#endif
);
if (previousSource == source && File.GetLastWriteTime(spec.OutputPath) > File.GetLastWriteTime(spec.Path))
{
continue;
@@ -197,7 +205,13 @@ class Program
string line = lines[i];
if (line.Length > 2 && line[0] == '#')
{
int level = line.IndexOf(' ', StringComparison.Ordinal);
int level = line.IndexOf(
#if NET
' '
#else
" "
#endif
, StringComparison.Ordinal);
while (headings.Count != 0)
{
if (headings.Last.Value.Level < level) break;
@@ -359,7 +373,13 @@ class Program
static string CompressedName(string name)
{
string compressedName = "";
foreach (var part in name.Replace(',' , ' ').Replace('-', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries))
foreach (var part in name.Replace(',' , ' ').Replace('-', ' ').Split(
#if NET
' '
#else
[' ']
#endif
, StringSplitOptions.RemoveEmptyEntries))
{
compressedName += char.IsLower(part[0])
? char.ToUpper(part[0]) + (part.Length > 1 ? part.Substring(1) : "")