Skip to content

Commit

Permalink
Test for handler functions not interfering with CSS id queries
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Apr 12, 2019
1 parent 6cdb49b commit 7ffd2f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/files/tlm.html
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ <h3>Step 3: Upload the video file</h3>
</div>

<div id="abc.123" class='special.character'>Special character div</div>
<div id="partial_collision_id">Partial collision id</div>
<div id="footer">
A design by <a href="http://blog.geminigeek.com/wordpress-theme">GeminiGeek</a> &bull; Powered by <a href="http://wordpress.org">Wordpress</a><!--&bull; <a href="#">CSS</a> &bull; <a href="#">xHTML 1.0</a>-->
</div>
Expand Down
9 changes: 9 additions & 0 deletions test/html/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,15 @@ def awesome divs
}.new)
end

def test_find_with_partial_id_collision_function
found_by_id = @html.css("#partial_collision_id", Class.new {
def collision nodes
[nodes.first]
end
}.new)
assert_equal 1, found_by_id.length
end

def test_dup_shallow
found = @html.search('//div/a').first
dup = found.dup(0)
Expand Down

0 comments on commit 7ffd2f5

Please sign in to comment.