Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gettalong committed Mar 20, 2023
1 parent da85e1e commit 4381f17
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion test/test_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class TestFiles < Minitest::Test
'test/testcases/span/05_html/mark_element.html', # bc of tidy
'test/testcases/block/09_html/xml.html', # bc of tidy
'test/testcases/span/05_html/xml.html', # bc of tidy
'test/testcases/block/04_header/with_header_links.html', # because of header_links option
].compact
EXCLUDE_HTML_TEXT_FILES = [
'test/testcases/block/09_html/parse_as_span.htmlinput',
Expand Down Expand Up @@ -240,6 +241,7 @@ def tidy_output(out)
'test/testcases/span/04_footnote/backlink_inline.html', # bc of mathjax
'test/testcases/block/09_html/standalone_image_in_div.html', # bc of standalone image
'test/testcases/block/09_html/processing_instruction.html', # bc of PI
'test/testcases/block/04_header/with_header_links.html', # bc of header_links option
].compact
Dir[File.dirname(__FILE__) + '/testcases/**/*.html'].each do |html_file|
next if EXCLUDE_HTML_KD_FILES.any? {|f| html_file =~ /#{f}$/ }
Expand All @@ -266,7 +268,7 @@ def tidy_output(out)

EXCLUDE_MODIFY = [
'test/testcases/block/06_codeblock/rouge/multiple.text', # bc of HTMLFormater in options
'test/testcases/block/04_header/with_header_links.text', # we add an anchor tag
'test/testcases/block/04_header/with_header_links.text', # bc of header_links option
].compact

# Generate test methods for asserting that converters don't modify the document tree.
Expand Down
8 changes: 3 additions & 5 deletions test/testcases/block/04_header/with_header_links.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<h1 id="this-is-a-header"><a href="#this-is-a-header"></a>This is a header</h1>
<h1 id="header"><a href="#header"></a>This is a header</h1>

<h2 id="another-one-1-here"><a href="#another-one-1-here"></a>12. Another one-1-here</h2>
<h2>12. Another one-1-here</h2>

<h3 id="do--it-now"><a href="#do--it-now"></a>Do ^&amp; it now</h3>

<h1 id="header-with-childrenhttpexamplecom"><a href="#header-with-childrenhttpexamplecom"></a>Header <em>with <a href="http://example.com">children</a></em></h1>
<h3>Do ^&amp; it now</h3>

<h1>Header without ID</h1>
1 change: 1 addition & 0 deletions test/testcases/block/04_header/with_header_links.options
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
:header_links: true
:auto_ids: false
4 changes: 1 addition & 3 deletions test/testcases/block/04_header/with_header_links.text
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# This is a header
# This is a header {#header}

## 12. Another one-1-here

### Do ^& it now

# Header *with [children](http://example.com)*

# Header without ID
{: id=""}

0 comments on commit 4381f17

Please sign in to comment.