[PR #294] Alternative specs generation #922

Closed
opened 2026-01-29 14:47:18 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/xoofx/markdig/pull/294

State: closed
Merged: Yes


This generates test csharp similar to Specs.tt with a few differences:

  • Tests from different specs are separated into different files (see ffdfd427ce) This makes it easier to see what changed in diffs
  • They are also in separate namespaces (makes navigating tests from TestViewer easier)
  • Removed partial class for TestFixtures (now tests are grouped into a single class - style change)

Parsing C# code

Comments and tests are kept the same.
Since this removes template generation, it means generation can be invoked during CI and the build failing if specs files are modified but not regenerated:
dd68351235/appveyor.yml (L31-L32)
dd68351235/src/SpecFileGen/Program.cs (L109-L113)

When running the SpecGen, files will only be modified if there are any changes (so as not to bump Generated timestamps for all files).

Addressing #192, including CommonMark.md as one of the spec files seems appropriate since the spec doesn't change versions too often.

**Original Pull Request:** https://github.com/xoofx/markdig/pull/294 **State:** closed **Merged:** Yes --- This generates test csharp similar to Specs.tt with a few differences: - Tests from different specs are separated into different files (see https://github.com/lunet-io/markdig/commit/ffdfd427ced1c94b40b630bfac4b6bed6a460ee9) This makes it easier to see what changed in diffs - They are also in separate namespaces (makes navigating tests from TestViewer easier) - Removed partial class for TestFixtures (now tests are grouped into a single class - style change) [Parsing C# code](https://github.com/lunet-io/markdig/blob/7887cf7348014b38b3f9c19b8ed38bcde9440bd5/src/SpecFileGen/Program.cs) Comments and tests are kept the same. Since this removes template generation, it means generation can be invoked during CI and the build failing if specs files are modified but not regenerated: https://github.com/lunet-io/markdig/blob/dd683512357006f43ab193dfc49166fcd53c7467/appveyor.yml#L31-L32 https://github.com/lunet-io/markdig/blob/dd683512357006f43ab193dfc49166fcd53c7467/src/SpecFileGen/Program.cs#L109-L113 When running the SpecGen, files will only be modified if there are any changes (so as not to bump Generated timestamps for all files). Addressing #192, including CommonMark.md as one of the spec files seems appropriate since the spec doesn't change versions too often.
claunia added the pull-request label 2026-01-29 14:47:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#922