root/trunk/vendor/bluecloth/tests/10_Bug.tests.rb

Revision 420, 1.2 kB (checked in by tobi, 3 years ago)

redcloth, bluecloth and rubypants are now bundeled with typo

Line 
1 #!/usr/bin/ruby
2 #
3 # Unit test for bugs found in BlueCloth
4 # $Id: 10_Bug.tests.rb 68 2004-08-25 05:14:37Z ged $
5 #
6 # Copyright (c) 2004 The FaerieMUD Consortium.
7 #
8
9 if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )
10         basedir = File::dirname( __FILE__ )
11         require File::join( basedir, 'bctestcase' )
12 end
13
14
15 require 'timeout'
16
17 ### This test case tests ...
18 class BugsTestCase < BlueCloth::TestCase
19         BaseDir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )
20
21         ### Test to be sure the README file can be transformed.
22         def test_00_slow_block_regex
23                 contents = File::read( File::join(BaseDir,"README") )
24                 bcobj = BlueCloth::new( contents )
25
26                 assert_nothing_raised {
27                         timeout( 2 ) do
28                                 bcobj.to_html
29                         end
30                 }
31         end
32
33         ### :TODO: Add more documents and test their transforms.
34
35         def test_10_regexp_engine_overflow_bug
36                 contents = File::read( File::join(BaseDir,"tests/data/re-overflow.txt") )
37                 bcobj = BlueCloth::new( contents )
38
39                 assert_nothing_raised {
40                         bcobj.to_html
41                 }
42         end
43        
44         def test_15_regexp_engine_overflow_bug2
45                 contents = File::read( File::join(BaseDir,"tests/data/re-overflow2.txt") )
46                 bcobj = BlueCloth::new( contents )
47
48                 assert_nothing_raised {
49                         bcobj.to_html
50                 }
51         end
52        
53 end
54
55
56 __END__
57
Note: See TracBrowser for help on using the browser.