Fix broken test and add test for HTML_SMARTYPANTS_DASHES
Vytautas Ĺ altenis vytas@rtfb.lt
Tue, 27 Oct 2015 20:21:08 +0200
1 files changed,
39 insertions(+),
1 deletions(-)
jump to
M
inline_test.go
→
inline_test.go
@@ -1026,7 +1026,7 @@
"blahblah\n<!--- foo -->\nrhubarb\n", "<p>blahblah\n<!--- foo -->\nrhubarb</p>\n", } - doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS, HtmlRendererParameters{}) + doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_DASHES, HtmlRendererParameters{}) } func TestSmartDoubleQuotes(t *testing.T) {@@ -1070,3 +1070,41 @@ "<p>1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.</p>\n"}
doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_FRACTIONS, HtmlRendererParameters{}) } + +func TestDisableSmartDashes(t *testing.T) { + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo -- bar</p>\n", + "foo --- bar\n", + "<p>foo --- bar</p>\n", + }, Options{}, 0, HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo – bar</p>\n", + "foo -- bar\n", + "<p>foo — bar</p>\n", + "foo --- bar\n", + "<p>foo —– bar</p>\n", + }, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_DASHES, HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo – bar</p>\n", + "foo --- bar\n", + "<p>foo — bar</p>\n", + }, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_LATEX_DASHES|HTML_SMARTYPANTS_DASHES, + HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo -- bar</p>\n", + "foo --- bar\n", + "<p>foo --- bar</p>\n", + }, Options{}, + HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_LATEX_DASHES, + HtmlRendererParameters{}) +}