#!/usr/bin/env ruby #$Id: test-fireball-markdown.rb 148 2006-07-22 14:04:20Z larry $ $:.unshift File.join(File.dirname(__FILE__), "../..", "lib") require 'test/unit' require 'tartan' require 'markdown' require 'profile' class TestMarkdown < Test::Unit::TestCase def setup @basePara = "Now is the time for all good men..." @nl = "\n" end def testAmps text = File.open('Amps and angle encoding.text').read truehtml = File.open('Amps and angle encoding.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testAutolinks text = File.open('Auto links.text').read truehtml = File.open('Auto links.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testBackslashsimpleescapes text = File.open('Backslash simpleescapes.text').read truehtml = File.open('Backslash simpleescapes.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testBackslashcodeescapes text = File.open('Backslash codeescapes.text').read truehtml = File.open('Backslash codeescapes.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testBlockquoteswithcodeblocks text = File.open('Blockquotes with code blocks.text').read truehtml = File.open('Blockquotes with code blocks.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testHardwrappedparagraphswithlistlikelines text = File.open('Hard-wrapped paragraphs with list-like lines.text').read truehtml = File.open('Hard-wrapped paragraphs with list-like lines.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testHorizontalrules text = File.open('Horizontal rules.text').read truehtml = File.open('Horizontal rules.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testInlineHTMLcomments text = File.open('Inline HTML comments.text').read truehtml = File.open('Inline HTML comments.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testInlineHTMLAdvanced text = File.open('Inline HTML (Advanced).text').read truehtml = File.open('Inline HTML (Advanced).html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testInlineHTMLSimple text = File.open('Inline HTML (Simple).text').read truehtml = File.open('Inline HTML (Simple).html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testLinksinlinestyle text = File.open('Links, inline style.text').read truehtml = File.open('Links, inline style.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testLinksreferencestyle text = File.open('Links, reference style.text').read truehtml = File.open('Links, reference style.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testLiteralquotesintitles text = File.open('Literal quotes in titles.text').read truehtml = File.open('Literal quotes in titles.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testMarkdownDocumentationBasics text = File.open('Markdown Documentation - Basics.text').read truehtml = File.open('Markdown Documentation - Basics.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testMarkdownDocumentationSyntax text = File.open('Markdown Documentation - Syntax.text').read truehtml = File.open('Markdown Documentation - Syntax.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testNestedblockquotes text = File.open('Nested blockquotes.text').read truehtml = File.open('Nested blockquotes.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testOrderedandunorderedlists text = File.open('Ordered and unordered lists.text').read truehtml = File.open('Ordered and unordered lists.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testStrongandemtogether text = File.open('Strong and em together.text').read truehtml = File.open('Strong and em together.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testTabs text = File.open('Tabs.text').read truehtml = File.open('Tabs.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end def testTidyness text = File.open('Tidyness.text').read truehtml = File.open('Tidyness.html').read wp = Wikiparser.new(text) html = wp.to_html assert_equal truehtml, html end end