10_bug.tests.rb

来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RB 代码 · 共 58 行

RB
58
字号
#!/usr/bin/ruby## Unit test for bugs found in BlueCloth# $Id: 10_Bug.tests.rb 68 2004-08-25 05:14:37Z ged $## Copyright (c) 2004 The FaerieMUD Consortium.# if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )	basedir = File::dirname( __FILE__ )	require File::join( basedir, 'bctestcase' )endrequire 'timeout'### This test case tests ...class BugsTestCase < BlueCloth::TestCase	BaseDir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )	### Test to be sure the README file can be transformed.	def test_00_slow_block_regex		contents = File::read( File::join(BaseDir,"README") )		bcobj = BlueCloth::new( contents )		assert_nothing_raised {			timeout( 2 ) do				bcobj.to_html			end		}	end	### :TODO: Add more documents and test their transforms.	def test_10_regexp_engine_overflow_bug		contents = File::read( File::join(BaseDir,"tests/data/re-overflow.txt") )		bcobj = BlueCloth::new( contents )		assert_nothing_raised {			bcobj.to_html		}	end		def test_15_regexp_engine_overflow_bug2		contents = File::read( File::join(BaseDir,"tests/data/re-overflow2.txt") )		bcobj = BlueCloth::new( contents )		assert_nothing_raised {			bcobj.to_html		}	end	end__END__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?