From 801d3074051f17784d073d3b120ea6c3906dacc2 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Tue, 10 Mar 2009 00:15:03 -0500 Subject: [PATCH] BlahTeX Tests Commit some basic tests for the BlahTeX support. I hope Ari Stern comes up with a more comprehensive test suite. --- test/unit/page_renderer_test.rb | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index 51c8be32..4595fdee 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -207,9 +207,7 @@ END_THM end - def test_have_latest_itex2mml -# set_web_property :markup, :markdownMML - + def test_have_latest_itex2mml assert_markup_parsed_as( %{

equation } + @@ -217,6 +215,28 @@ END_THM "equation $A \\invamp B$") end + def test_blahtex + if Kernel::system('blahtex --help > /dev/null 2>&1') + set_web_property :markup, :markdownPNG + + re = Regexp.new( + %{

equation \\$a\\\\sin\\(\\\\theta\\)\\$

}) + assert_match_markup_parsed_as(re, 'equation $a\sin(\theta)$') + + re = Regexp.new( + %{
\\$a\\\\sin\\(\\\\theta\\)\\$a\\\\sin} + + %{\\(\\\\theta\\)<\/code><\/span><\/div>}) + assert_match_markup_parsed_as(re, '$$a\sin(\theta)$$') + + else + print "\nBlahTeX not found ... skipping.\n" + end + end + def test_markdown_hyperlink_with_slash # in response to a bug, see http://dev.instiki.org/attachment/ticket/177 set_web_property :markup, :markdown