Update tests

This commit is contained in:
Alexandre Mutel
2020-10-05 07:53:58 +02:00
parent ccb7e8edfa
commit cf6d98b7f8
30 changed files with 8 additions and 44 deletions

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Headings
@@ -79,15 +78,15 @@ namespace Markdig.Tests.Specs.Normalize.Headings
// Heading
// =======
//
// Text after two newlines
// Text after two newlines 1
//
// Should be rendered as:
// # Heading
//
// Text after two newlines
// Text after two newlines 1
Console.WriteLine("Example 3\nSection Headings\n");
TestNormalize.TestSpec("Heading\n=======\n\nText after two newlines", "# Heading\n\nText after two newlines", "");
TestNormalize.TestSpec("Heading\n=======\n\nText after two newlines 1", "# Heading\n\nText after two newlines 1", "");
}
}
}

View File

@@ -40,9 +40,9 @@ Text after two newlines
Heading
=======
Text after two newlines
Text after two newlines 1
.
# Heading
Text after two newlines
Text after two newlines 1
````````````````````````````````

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Sample

View File

@@ -1,4 +1,3 @@
// Generated: 2019-05-15 02:46:55
// --------------------------------
// Abbreviations

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Auto Identifiers

View File

@@ -1,4 +1,3 @@
// Generated: 2020-09-30 08:12:16
// --------------------------------
// Auto Links

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-15 05:23:49
// --------------------------------
// Bootstrap

View File

@@ -1,4 +1,3 @@
// Generated: 2020-08-28 11:05:04
// --------------------------------
// CommonMark v. 0.29

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Custom Containers

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-15 05:06:35
// --------------------------------
// Definition Lists

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Diagrams

View File

@@ -1,4 +1,3 @@
// Generated: 2020-01-13 21:08:58
// --------------------------------
// Emoji

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Emphasis Extra

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Figures, Footers and Cites

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-15 05:33:49
// --------------------------------
// Footnotes

View File

@@ -1,4 +1,3 @@
// Generated: 2019-08-01 13:57:17
// --------------------------------
// Generic Attributes

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-15 05:25:26
// --------------------------------
// Globalization

View File

@@ -1,4 +1,3 @@
// Generated: 2020-04-20 07:21:20
// --------------------------------
// Grid Tables

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Hardline Breaks

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-15 05:30:00
// --------------------------------
// Jira Links

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// List Extras

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Math

View File

@@ -1,4 +1,3 @@
// Generated: 2020-05-12 19:59:34
// --------------------------------
// Media

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// No Html

View File

@@ -1,4 +1,3 @@
// Generated: 2020-07-30 15:47:38
// --------------------------------
// GFM Pipe Tables

View File

@@ -1,4 +1,3 @@
// Generated: 2020-07-30 15:32:13
// --------------------------------
// Pipe Tables

View File

@@ -1,4 +1,3 @@
// Generated: 2019-08-01 12:33:23
// --------------------------------
// Smarty Pants

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Task Lists

View File

@@ -1,4 +1,3 @@
// Generated: 2019-04-05 16:06:14
// --------------------------------
// Yaml

View File

@@ -110,20 +110,12 @@ namespace SpecFileGen
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);
int start = previousSource.IndexOf('\n', StringComparison.Ordinal) + 1;
int previousLength = previousSource.Length - start;
if (start != 0 && previousLength == source.Length)
if (previousSource == source)
{
if (previousSource.IndexOf(source, start, previousLength, StringComparison.Ordinal) == start)
{
// The source did not change
continue;
}
continue;
}
}
string generated = "// Generated: " + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") + '\n';
File.WriteAllText(spec.OutputPath, generated + source);
File.WriteAllText(spec.OutputPath, source);
anyChanged = true;
}