From d5c41f6f1fee0dd8fb21f2ad0de1cb78e3162b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Sun, 29 Sep 2024 00:03:26 +0200 Subject: [PATCH] Remove superfluous testcases --- markdown/markdown_test.go | 23 ++++++++++++--- testdata/codes-droph1.html | 20 ------------- testdata/header-stripnewlines.html | 7 ----- testdata/issue-64-broken-link-droph1.html | 1 - .../issue-64-broken-link-stripnewlines.html | 1 - testdata/links-droph1.html | 21 -------------- testdata/links-stripnewlines.html | 21 -------------- testdata/lists-droph1.html | 21 -------------- testdata/lists-stripnewlines.html | 21 -------------- testdata/macro-include-droph1.html | 26 ----------------- testdata/newlines-droph1.html | 10 ------- testdata/pagelayout-droph1.html | 18 ------------ testdata/pagelayout-stripnewlines.html | 18 ------------ testdata/table-droph1.html | 28 ------------------- testdata/table-stripnewlines.html | 28 ------------------- testdata/tags-droph1.html | 6 ---- testdata/tags-stripnewlines.html | 6 ---- 17 files changed, 19 insertions(+), 257 deletions(-) delete mode 100644 testdata/codes-droph1.html delete mode 100644 testdata/header-stripnewlines.html delete mode 100644 testdata/issue-64-broken-link-droph1.html delete mode 100644 testdata/issue-64-broken-link-stripnewlines.html delete mode 100644 testdata/links-droph1.html delete mode 100644 testdata/links-stripnewlines.html delete mode 100644 testdata/lists-droph1.html delete mode 100644 testdata/lists-stripnewlines.html delete mode 100644 testdata/macro-include-droph1.html delete mode 100644 testdata/newlines-droph1.html delete mode 100644 testdata/pagelayout-droph1.html delete mode 100644 testdata/pagelayout-stripnewlines.html delete mode 100644 testdata/table-droph1.html delete mode 100644 testdata/table-stripnewlines.html delete mode 100644 testdata/tags-droph1.html delete mode 100644 testdata/tags-stripnewlines.html diff --git a/markdown/markdown_test.go b/markdown/markdown_test.go index 24780840..51ab081c 100644 --- a/markdown/markdown_test.go +++ b/markdown/markdown_test.go @@ -66,7 +66,7 @@ func TestCompileMarkdownDropH1(t *testing.T) { test := assert.New(t) - testcases, err := filepath.Glob("testdata/*.md") + testcases, err := filepath.Glob("testdata/*.md") if err != nil { panic(err) } @@ -76,7 +76,14 @@ func TestCompileMarkdownDropH1(t *testing.T) { if err != nil { panic(err) } - markdown, htmlname, html := loadData(t, filename, "-droph1") + var variant string + switch filename { + case "testdata/quotes.md", "testdata/header.md": + variant = "-droph1" + default: + variant = "" + } + markdown, htmlname, html := loadData(t, filename, variant) actual, _ := CompileMarkdown(markdown, lib, filename, "", 1.0, true, false) test.EqualValues(string(html), actual, filename+" vs "+htmlname) } @@ -92,7 +99,7 @@ func TestCompileMarkdownStripNewlines(t *testing.T) { test := assert.New(t) - testcases, err := filepath.Glob("testdata/*.md") + testcases, err := filepath.Glob("testdata/*.md") if err != nil { panic(err) } @@ -102,7 +109,15 @@ func TestCompileMarkdownStripNewlines(t *testing.T) { if err != nil { panic(err) } - markdown, htmlname, html := loadData(t, filename, "-stripnewlines") + var variant string + switch filename { + case "testdata/quotes.md", "testdata/codes.md", "testdata/newlines.md", "testdata/macro-include.md": + variant = "-stripnewlines" + default: + variant = "" + } + + markdown, htmlname, html := loadData(t, filename, variant) actual, _ := CompileMarkdown(markdown, lib, filename, "", 1.0, false, true) test.EqualValues(string(html), actual, filename+" vs "+htmlname) } diff --git a/testdata/codes-droph1.html b/testdata/codes-droph1.html deleted file mode 100644 index 733410bb..00000000 --- a/testdata/codes-droph1.html +++ /dev/null @@ -1,20 +0,0 @@ -

inline

-falsebashfalsebashfalseunknownfalse

text -text 2

-unknownfalseshfalseA b cbashtrueA b cctruenestedfalsefalsetruefalseB; - A-->C; - B-->D; - C-->D;]]>truetruemy mermaid graphB; - A-->C; - B-->D; - C-->D;]]>truefalsemy mermaid graphB; - A-->C; - B-->D; - C-->D;]]> \ No newline at end of file diff --git a/testdata/header-stripnewlines.html b/testdata/header-stripnewlines.html deleted file mode 100644 index 566c4ae1..00000000 --- a/testdata/header-stripnewlines.html +++ /dev/null @@ -1,7 +0,0 @@ -

a

-

b

-

c

-

d

-
e
-

f

-

g

diff --git a/testdata/issue-64-broken-link-droph1.html b/testdata/issue-64-broken-link-droph1.html deleted file mode 100644 index 0d39ce86..00000000 --- a/testdata/issue-64-broken-link-droph1.html +++ /dev/null @@ -1 +0,0 @@ -

v71

diff --git a/testdata/issue-64-broken-link-stripnewlines.html b/testdata/issue-64-broken-link-stripnewlines.html deleted file mode 100644 index 0d39ce86..00000000 --- a/testdata/issue-64-broken-link-stripnewlines.html +++ /dev/null @@ -1 +0,0 @@ -

v71

diff --git a/testdata/links-droph1.html b/testdata/links-droph1.html deleted file mode 100644 index d9ca6030..00000000 --- a/testdata/links-droph1.html +++ /dev/null @@ -1,21 +0,0 @@ -

Use https://example.com

-

Use aaa

-

Use

-

Use

-

Use

-

Use

-

Use

-

-

-

-

-

Use footnotes link 1

-

Use Link [Text]

-
-
-
    -
  1. -

    a footnote link ↩︎

    -
  2. -
-
diff --git a/testdata/links-stripnewlines.html b/testdata/links-stripnewlines.html deleted file mode 100644 index d9ca6030..00000000 --- a/testdata/links-stripnewlines.html +++ /dev/null @@ -1,21 +0,0 @@ -

Use https://example.com

-

Use aaa

-

Use

-

Use

-

Use

-

Use

-

Use

-

-

-

-

-

Use footnotes link 1

-

Use Link [Text]

-
-
-
    -
  1. -

    a footnote link ↩︎

    -
  2. -
-
diff --git a/testdata/lists-droph1.html b/testdata/lists-droph1.html deleted file mode 100644 index af27c543..00000000 --- a/testdata/lists-droph1.html +++ /dev/null @@ -1,21 +0,0 @@ - -

text

- diff --git a/testdata/lists-stripnewlines.html b/testdata/lists-stripnewlines.html deleted file mode 100644 index af27c543..00000000 --- a/testdata/lists-stripnewlines.html +++ /dev/null @@ -1,21 +0,0 @@ - -

text

- diff --git a/testdata/macro-include-droph1.html b/testdata/macro-include-droph1.html deleted file mode 100644 index ccf51275..00000000 --- a/testdata/macro-include-droph1.html +++ /dev/null @@ -1,26 +0,0 @@ -bar - -true -Attention -This is an info! - - -true -Attention - - - - - - - - - - - - - - -
Header 1Header 2
Cell ACell B
-
-
diff --git a/testdata/newlines-droph1.html b/testdata/newlines-droph1.html deleted file mode 100644 index b97e5101..00000000 --- a/testdata/newlines-droph1.html +++ /dev/null @@ -1,10 +0,0 @@ -

one-1 -one-2

-

two-1

-

two-2

-

three-1

-

three-2

-

space-1 -space-2

-

2space-1
-2space-2

diff --git a/testdata/pagelayout-droph1.html b/testdata/pagelayout-droph1.html deleted file mode 100644 index a2442025..00000000 --- a/testdata/pagelayout-droph1.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -

More Content

-
- -

More Content

-
- -

Even More Content

-
-
- - -

Still More Content

-
-
-
diff --git a/testdata/pagelayout-stripnewlines.html b/testdata/pagelayout-stripnewlines.html deleted file mode 100644 index a2442025..00000000 --- a/testdata/pagelayout-stripnewlines.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -

More Content

-
- -

More Content

-
- -

Even More Content

-
-
- - -

Still More Content

-
-
-
diff --git a/testdata/table-droph1.html b/testdata/table-droph1.html deleted file mode 100644 index 615d12e7..00000000 --- a/testdata/table-droph1.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - -
HEADER1HEADER2
row1row2
- - - - - - - - - - - - - -
HEADER1HEADER2
row1row2
diff --git a/testdata/table-stripnewlines.html b/testdata/table-stripnewlines.html deleted file mode 100644 index 615d12e7..00000000 --- a/testdata/table-stripnewlines.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - -
HEADER1HEADER2
row1row2
- - - - - - - - - - - - - -
HEADER1HEADER2
row1row2
diff --git a/testdata/tags-droph1.html b/testdata/tags-droph1.html deleted file mode 100644 index 7fd51c0f..00000000 --- a/testdata/tags-droph1.html +++ /dev/null @@ -1,6 +0,0 @@ -bold -

bold

-vitalik -

vitalik

-strikethrough -

strikethrough

diff --git a/testdata/tags-stripnewlines.html b/testdata/tags-stripnewlines.html deleted file mode 100644 index 7fd51c0f..00000000 --- a/testdata/tags-stripnewlines.html +++ /dev/null @@ -1,6 +0,0 @@ -bold -

bold

-vitalik -

vitalik

-strikethrough -

strikethrough