summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-26 00:31:00 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-16 15:47:27 +0900
commit3651f678a719ae3a35825bcb4e0dabbc7c60d8df (patch)
treef8705c06212e4778780c1db52b99ae17d319e33d /test/rdoc
parent05898c5b9001c0b1e8bd7bf0d12b42a8e7c388b8 (diff)
[ruby/rdoc] Support GFM table
https://github.com/ruby/rdoc/commit/9dc933df16
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4274
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_markdown.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markdown.rb b/test/rdoc/test_rdoc_markdown.rb
index 9c7a406224..697a1c600d 100644
--- a/test/rdoc/test_rdoc_markdown.rb
+++ b/test/rdoc/test_rdoc_markdown.rb
@@ -1012,6 +1012,29 @@ and an extra note.[^2]
assert_equal expected, doc
end
+ def test_gfm_table
+ doc = parse <<~MD
+ | | |compare-ruby|built-ruby|
+ |------|:----------------|-----------:|---------:|
+ |test | 1 | 11.618M| 10.757M|
+ | | | 1.08x| -|
+ |test | 10 | 1.849M| 1.723M|
+ | | | 1.07x| -|
+ MD
+
+ head = ["", "", "compare-ruby", "built-ruby"]
+ align = [nil, :left, :right, :right]
+ body = [
+ ["test", "1", "11.618M", "10.757M"],
+ ["", "", "1.08x", "-"],
+ ["test", "10", "1.849M", "1.723M"],
+ ["", "", "1.07x", "-"],
+ ]
+ expected = doc(@RM::Table.new(head, align, body))
+
+ assert_equal expected, doc
+ end
+
def parse text
@parser.parse text
end