[ruby/rdoc] test: Add tests for RDoc::TokenStream#add_tokens, add_token ,collect_tokens and pop_token

https://github.com/ruby/rdoc/commit/9ed530b8f9
This commit is contained in:
toshimaru 2023-12-14 04:46:20 +09:00 коммит произвёл git
Родитель c388784943
Коммит 193ebc3c3a
1 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,42 @@ class TestRDocTokenStream < RDoc::TestCase
assert_equal '', RDoc::TokenStream.to_html([]) assert_equal '', RDoc::TokenStream.to_html([])
end end
def test_add_tokens
foo = Class.new do
include RDoc::TokenStream
end.new
foo.collect_tokens
foo.add_tokens([:token])
assert_equal [:token], foo.token_stream
end
def test_add_token
foo = Class.new do
include RDoc::TokenStream
end.new
foo.collect_tokens
foo.add_token(:token)
assert_equal [:token], foo.token_stream
end
def test_collect_tokens
foo = Class.new do
include RDoc::TokenStream
end.new
foo.collect_tokens
assert_equal [], foo.token_stream
end
def test_pop_token
foo = Class.new do
include RDoc::TokenStream
end.new
foo.collect_tokens
foo.add_token(:token)
foo.pop_token
assert_equal [], foo.token_stream
end
def test_token_stream def test_token_stream
foo = Class.new do foo = Class.new do
include RDoc::TokenStream include RDoc::TokenStream