diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-10-05 20:07:02 +0900 |
---|---|---|
committer | git <[email protected]> | 2022-11-27 17:24:38 +0000 |
commit | 21977b95e238da08ee2dc50fe5a908f11feb130c (patch) | |
tree | eb6a2ef089233213d412296475cc042286ae7c72 /test | |
parent | 29862ce27303107935de6df4f85dd7fd610f19e2 (diff) |
[ruby/rdoc] Refactor `RDoc::Markup::Parser#tokenize`
Make verbatims text or newline only, and simplify `build_verbatim`.
https://github.com/ruby/rdoc/commit/41ceae93b3
Diffstat (limited to 'test')
-rw-r--r-- | test/rdoc/test_rdoc_markup_parser.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/rdoc/test_rdoc_markup_parser.rb b/test/rdoc/test_rdoc_markup_parser.rb index 6fccf09612..26c4cdc7db 100644 --- a/test/rdoc/test_rdoc_markup_parser.rb +++ b/test/rdoc/test_rdoc_markup_parser.rb @@ -1591,8 +1591,7 @@ Example heading: [:TEXT, 'Example heading:', 0, 0], [:NEWLINE, "\n", 16, 0], [:NEWLINE, "\n", 0, 1], - [:HEADER, 3, 3, 2], - [:TEXT, 'heading three', 7, 2], + [:TEXT, '=== heading three', 3, 2], [:NEWLINE, "\n", 20, 2], ] @@ -1608,7 +1607,7 @@ Example heading: expected = [ [:TEXT, 'Verbatim section here that is double-underlined', 2, 0], [:NEWLINE, "\n", 49, 0], - [:HEADER, 47, 2, 1], + [:TEXT, '='*47, 2, 1], [:NEWLINE, "\n", 49, 1], ] @@ -1624,14 +1623,14 @@ Example heading: STR expected = [ - [:TEXT, 'A', 2, 0], - [:NEWLINE, "\n", 3, 0], - [:TEXT, 'b', 4, 1], - [:NEWLINE, "\n", 5, 1], - [:HEADER, 47, 2, 2], - [:NEWLINE, "\n", 49, 2], - [:TEXT, 'c', 4, 3], - [:NEWLINE, "\n", 5, 3], + [:TEXT, 'A', 2, 0], + [:NEWLINE, "\n", 3, 0], + [:TEXT, 'b', 4, 1], + [:NEWLINE, "\n", 5, 1], + [:TEXT, '='*47, 2, 2], + [:NEWLINE, "\n", 49, 2], + [:TEXT, 'c', 4, 3], + [:NEWLINE, "\n", 5, 3], ] assert_equal expected, @RMP.tokenize(str) |