<commit_before>require 'rubygems'
require 'test/unit'
require 'test_case_result'
require 'hpricot'

class TestCaseResultTest < Test::Unit::TestCase
  
  def test_xml_generation_for_succeed_test
    test_case = TestCaseResult.new("mytest")
    assert_equal(%{<testcase name="mytest">\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_include_failure_message_if_provided
    test_case = TestCaseResult.new("mytest")
    test_case.failure_message = "bad stuff happened"
    assert_equal(%{<testcase name="mytest">\n  <failure message="bad stuff happened"/>\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_escape_failure_message
    test_case = TestCaseResult.new("mytest")
    test_case.failure_message = "<p>"
    assert_equal(%{<testcase name="mytest">\n  <failure message="&lt;p&gt;"/>\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_include_error_message_if_provided
    test_case = TestCaseResult.new("mytest")
    test_case.error_message = "VERY bad stuff happened"<commit_msg>remove unused gem requirement for hpricot<commit_after>require 'rubygems'
require 'test/unit'
require 'test_case_result'

class TestCaseResultTest < Test::Unit::TestCase
  
  def test_xml_generation_for_succeed_test
    test_case = TestCaseResult.new("mytest")
    assert_equal(%{<testcase name="mytest">\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_include_failure_message_if_provided
    test_case = TestCaseResult.new("mytest")
    test_case.failure_message = "bad stuff happened"
    assert_equal(%{<testcase name="mytest">\n  <failure message="bad stuff happened"/>\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_escape_failure_message
    test_case = TestCaseResult.new("mytest")
    test_case.failure_message = "<p>"
    assert_equal(%{<testcase name="mytest">\n  <failure message="&lt;p&gt;"/>\n</testcase>\n}, test_case.to_xml)
  end
  
  def test_xml_should_include_error_message_if_provided
    test_case = TestCaseResult.new("mytest")
    test_case.error_message = "VERY bad stuff happened"
{'fraction_non_alphanumeric': 0.11861137897782063, 'fraction_numerical': 0.0, 'mean_word_length': 5.5664556962025316, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '3820024', 'n_tokens_mistral': 721, 'n_tokens_neox': 726, 'n_words': 114}