<commit_before>require 'minitest/autorun'
require 'test/helpers.rb'

class TestElement < MiniTest::Unit::TestCase
  def setup
    @r = Render::HTML
  end

  def test_raw_para
    e = Element.new(:para, 'a', 'b')
    t = @r.render(e)
    assert_equal t, '<p>ab</p>'
  end

  def test_para_with_inline
    e = Element.new(:para, 'a', Element.new(:bold, 'b'))
    t = @r.render(e)
    assert_equal t, '<p>a<b>b</b></p>'
  end

  def test_nested_inline
    e = Element.new(:quote, 'q', Element.new(:bold, 'b', Element.new(:italic, 'i')))
    t = @r.render(e)
    assert_equal t, '<blockquote>q<b>b<i>i</i></b></blockquote>'
  end
end<commit_msg>added test for to_html<commit_after>require 'minitest/autorun'
require 'test/helpers.rb'

class TestElement < MiniTest::Unit::TestCase
  def setup
    @r = Render::HTML
  end

  def test_raw_para
    e = Element.new(:para, 'a', 'b')
    t = @r.render(e)
    assert_equal t, '<p>ab</p>'
  end

  def test_para_with_inline
    e = Element.new(:para, 'a', Element.new(:bold, 'b'))
    t = @r.render(e)
    assert_equal t, '<p>a<b>b</b></p>'
  end

  def test_nested_inline
    e = Element.new(:quote, 'q', Element.new(:bold, 'b', Element.new(:italic, 'i')))
    t = @r.render(e)
    assert_equal t, '<blockquote>q<b>b<i>i</i></b></blockquote>'
  end

  def test_to_html
    e = Element.new(:quote, 'q', Element.new(:bold, 'b', Element.new(:italic, 'i')))
    assert_equal e.to_html, '<blockquote>q<b>b<i>i</i></b></blockquote>'
  end
end
{'fraction_non_alphanumeric': 0.19728813559322034, 'fraction_numerical': 0.0, 'mean_word_length': 3.700636942675159, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5860678', 'n_tokens_mistral': 601, 'n_tokens_neox': 599, 'n_words': 121}