Skip to content

Commit

Permalink
Added tests for the convert_inline_callout() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhradilek committed Nov 13, 2024
1 parent f53acdb commit 5ee2c35
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/test_inline_callout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require 'minitest/autorun'
require_relative 'helper'

class InlineCalloutTest < Minitest::Test
def test_callout_number_range
xml = <<~EOF.chomp.to_dita
....
1: <1>
....
....
20: <20>
....
....
21: <21>
....
....
35: <35>
....
....
36: <36>
....
....
50: <50>
....
EOF

# Three ranges of symbols are used to cover numbers between 1 and 50:
assert_xpath_equal xml, '1: &#9312;', '//pre[contains(., "1:")]/text()'
assert_xpath_equal xml, '20: &#9331;', '//pre[contains(., "20:")]/text()'
assert_xpath_equal xml, '21: &#12881;', '//pre[contains(., "21:")]/text()'
assert_xpath_equal xml, '35: &#12895;', '//pre[contains(., "35:")]/text()'
assert_xpath_equal xml, '36: &#12977;', '//pre[contains(., "36:")]/text()'
assert_xpath_equal xml, '50: &#12991;', '//pre[contains(., "50:")]/text()'
end
end

0 comments on commit 5ee2c35

Please sign in to comment.