Skip to content

Commit

Permalink
test: Adjust tests to changed behavior of MkDocsTestFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0llo committed Mar 5, 2020
1 parent 939ba14 commit 80a7914
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This implementation works largely the same as [DefaultTextFormatter](../DefaultT

- `<` is escaped as `&lt;`.
- `>` is escaped as `&gt;`.
- `/` is not escaped.

## Fields

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class MkDocsTextFormatterTest
[Theory]
[InlineData("<", "&lt;")]
[InlineData(">", "&gt;")]
[InlineData("/", "\\/")]
[InlineData("\\", "\\\\")]
[InlineData("*", "\\*")]
[InlineData("_", "\\_")]
Expand All @@ -31,5 +30,21 @@ public void Escape_text_escapes_expected_characters(string input, string expecte
// ASSERT
Assert.Equal(expected, actual);
}



[Theory]
[InlineData("/")] // slashes must not escaped for MkDocs / Python Markdown
public void Escape_does_not_escape_non_escapable_characters(string input)
{// ARRANGE
var sut = MkDocsTextFormatter.Instance;

// ACT
var escaped = sut.EscapeText(input);

// ASSERT
Assert.Equal(input, escaped);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Grynwald.MarkdownGenerator
/// <list type="bullet">
/// <item><description><c>&lt;</c> is escaped as <c>&amp;lt;</c>.</description></item>
/// <item><description><c>&gt;</c> is escaped as <c>&amp;gt;</c>.</description></item>
/// <item><description><c>/</c> is not escaped.</description></item>
/// </list>
/// </remarks>
public sealed class MkDocsTextFormatter : ITextFormatter
Expand Down

0 comments on commit 80a7914

Please sign in to comment.