blob: 7937ebcace93108b9958eda849a8ac644963d8c0 [file] [log] [blame]
Unit tests for SimplifiedBackwardsTextIterator. It currently shows a bug that it generates an extra new line at the beginning.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS plainTextWithTextIterator("<div>hello</div>world") is "hello\nworld"
PASS plainTextWithBackwardsTextIterator("<div>hello</div>world") is "\nhello\nworld"
PASS plainTextWithTextIterator("<div>hello</div><div>world</div>") is "hello\nworld"
PASS plainTextWithBackwardsTextIterator("<div>hello</div><div>world</div>") is "\nhello\nworld"
PASS plainTextWithTextIterator("<div><b>h</b>ello <span>world</span></div>WebKit") is "hello world\nWebKit"
PASS plainTextWithBackwardsTextIterator("<div><b>h</b>ello <span>world</span></div>WebKit") is "\nhello world\nWebKit"
PASS plainTextWithTextIterator("hello<br>world<br>") is "hello\nworld\n"
PASS plainTextWithBackwardsTextIterator("hello<br>world<br>") is "hello\nworld"
PASS plainTextWithTextIterator("<ul><li>hello<li>world</ul>WebKit") is "hello\nworld\nWebKit"
PASS plainTextWithBackwardsTextIterator("<ul><li>hello<li>world</ul>WebKit") is "\n\nhello\nworld\nWebKit"
PASS plainTextWithTextIterator("<table><tr><td>hello</td><td>world</td></table>") is "hello world"
PASS plainTextWithBackwardsTextIterator("<table><tr><td>hello</td><td>world</td></table>") is "\n\nhello\nworld"
PASS plainTextWithBackwardsTextIterator("img<img>iframe<iframe></iframe>meter<meter></meter>progress<progress></progress><legend>legend</legend>imgrole<span role='img'></span><button>button</button>") is "img,iframe,meter,progress,\nlegend,imgrole,button,"
PASS plainTextWithBackwardsTextIterator("audio<audio controls><source src='test.mp3' type='audio/mpeg'></audio>file") is "audio,file"
PASS successfullyParsed is true
TEST COMPLETE