Project

General

Profile

Bug #1311 ยป test_yaml2.patch

coatl (caleb clausen), 09/30/2009 02:23 AM

View differences:

test/yaml/test_yaml.rb (working copy)
427 427
		)
428 428
	end
429 429

  
430
	#
431
	# Reports from N.Easterly & J.Trupiano : Tests with patch from daz
432
	# [ruby-core:23006] [Bug #1311] http://redmine.ruby-lang.org/issues/show/1311
433
	#
434
	def test_scan_scalar_nl
435
		assert_cycle(<<EoY)
436

  
437
 a
438
b
439
EoY
440
		assert_cycle(<<EoY)
441

  
442
 a
443
  b
444
c
445
EoY
446
		assert_cycle(<<EoY)
447

  
448
  a
449
 b
450
EoY
451
		assert_cycle("  Do I work?\nNo indent")
452
		assert_cycle("  \n  Do I work?\nNo indent")
453
		assert_cycle("\n  Do I work?\nNo indent")
454
		assert_cycle("\n")
455
		assert_cycle("\n\n")
456
		assert_cycle("\r\n")
457
	end
458

  
430 459
	def test_spec_multiline_scalars
431 460
		# Multiline flow scalars
432 461
	 	assert_parse_only(
......
1282 1311
    end
1283 1312
end
1284 1313

  
1285
if $0 == __FILE__
1286
  suite = Test::Unit::TestSuite.new('YAML')
1287
  ObjectSpace.each_object(Class) do |klass|
1288
    suite << klass.suite if (Test::Unit::TestCase > klass)
1289
  end
1290
  require 'test/unit/ui/console/testrunner'
1291
  Test::Unit::UI::Console::TestRunner.run(suite).passed?
1292
end
1314
#~ if $0 == __FILE__
1315
  #~ suite = Test::Unit::TestSuite.new('YAML')
1316
  #~ ObjectSpace.each_object(Class) do |klass|
1317
    #~ suite << klass.suite if (Test::Unit::TestCase > klass)
1318
  #~ end
1319
  #~ require 'test/unit/ui/console/testrunner'
1320
  #~ Test::Unit::UI::Console::TestRunner.run(suite).passed?
1321
#~ end