2017-11-27 05:45:24 -05:00
|
|
|
# frozen_string_literal: true
|
2019-08-08 10:09:24 -04:00
|
|
|
require_relative 'helper'
|
2012-11-26 23:28:14 -05:00
|
|
|
|
|
|
|
class TestRDocMarkupAttributes < RDoc::TestCase
|
|
|
|
|
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
|
|
|
@as = RDoc::Markup::Attributes.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_bitmap_for
|
|
|
|
assert_equal 2, @as.bitmap_for('two')
|
|
|
|
assert_equal 2, @as.bitmap_for('two')
|
|
|
|
assert_equal 4, @as.bitmap_for('three')
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_as_string
|
|
|
|
@as.bitmap_for 'two'
|
|
|
|
@as.bitmap_for 'three'
|
|
|
|
|
2018-10-17 02:28:20 -04:00
|
|
|
assert_equal 'none', @as.as_string(0)
|
|
|
|
assert_equal '_REGEXP_HANDLING_', @as.as_string(1)
|
|
|
|
assert_equal 'two', @as.as_string(2)
|
|
|
|
assert_equal '_REGEXP_HANDLING_,two', @as.as_string(3)
|
2012-11-26 23:28:14 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_each_name_of
|
|
|
|
@as.bitmap_for 'two'
|
|
|
|
@as.bitmap_for 'three'
|
|
|
|
|
|
|
|
assert_equal %w[], @as.each_name_of(0).to_a
|
|
|
|
assert_equal %w[], @as.each_name_of(1).to_a
|
|
|
|
assert_equal %w[two], @as.each_name_of(2).to_a
|
|
|
|
assert_equal %w[three], @as.each_name_of(4).to_a
|
|
|
|
assert_equal %w[two three], @as.each_name_of(6).to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|