Created
January 26, 2011 20:11
-
-
Save andre/797346 to your computer and use it in GitHub Desktop.
This will crash macruby inconsistently with "incorrect checksum for freed object - object was probably modified after being freed."
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "nokogiri" | |
puts "starting" | |
html=<<-EOS | |
<div class="result"> | |
<div> | |
<h1> | |
<span class="type">link</span> | |
<a href="http://yahoo.com">yahoo</a> | |
</h1> | |
<h3>title text</h3> | |
<p>paragraph text</p> | |
<p class="attribution"> | |
attribution text | |
</p> | |
</div> | |
</div> | |
EOS | |
doc = Nokogiri::HTML(html) | |
puts "Nokogiri parsed the html" | |
10.times do |t| | |
print "Run ##{t}: " | |
results = doc.css("div.result") | |
results.each do |result| | |
print"OK" | |
a=result.at_css("a") | |
p=result.at_css("p") | |
div=result.at_css("div") | |
attribution=result.at_css "p.attribution" | |
end | |
puts "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment