<commit_before>require File.dirname(__FILE__) + '/helper'

class TestFilters < Test::Unit::TestCase
  
  class JekyllFilter
    include Jekyll::Filters
  end
  
  def setup
    @filter = JekyllFilter.new
  end

  def test_array_to_sentence_string_with_no_args
    assert_equal "", @filter.array_to_sentence_string([])
  end

  def test_array_to_sentence_string_with_one_arg
    assert_equal "1", @filter.array_to_sentence_string([1])
    assert_equal "chunky", @filter.array_to_sentence_string(["chunky"])
  end
  
  def test_array_to_sentence_string_with_two_args
    assert_equal "1 and 2", @filter.array_to_sentence_string([1, 2])
    assert_equal "chunky and bacon", @filter.array_to_sentence_string(["chunky", "bacon"])
  end
  
  def test_array_to_sentence_string_with_multiple_args
    assert_equal "1, 2, 3, and 4", @filter.array_to_sentence_string([1, 2, 3, 4])
    assert_equal "chunky, bacon, bits, and pieces", @filter.array_to_sentence_string(["chunky", "bacon", "bits", "pieces"])
  end
  
end<commit_msg>add minimal tests for xml_escape filter<commit_after>require File.dirname(__FILE__) + '/helper'

class TestFilters < Test::Unit::TestCase
  
  class JekyllFilter
    include Jekyll::Filters
  end
  
  def setup
    @filter = JekyllFilter.new
  end

  def test_array_to_sentence_string_with_no_args
    assert_equal "", @filter.array_to_sentence_string([])
  end

  def test_array_to_sentence_string_with_one_arg
    assert_equal "1", @filter.array_to_sentence_string([1])
    assert_equal "chunky", @filter.array_to_sentence_string(["chunky"])
  end
  
  def test_array_to_sentence_string_with_two_args
    assert_equal "1 and 2", @filter.array_to_sentence_string([1, 2])
    assert_equal "chunky and bacon", @filter.array_to_sentence_string(["chunky", "bacon"])
  end
  
  def test_array_to_sentence_string_with_multiple_args
    assert_equal "1, 2, 3, and 4", @filter.array_to_sentence_string([1, 2, 3, 4])
    assert_equal "chunky, bacon, bits, and pieces", @filter.array_to_sentence_string(["chunky", "bacon", "bits", "pieces"])
  end
  
  def test_xml_escape_with_ampersands
    assert_equal "AT&amp;T", @filter.xml_escape("AT&T")
    assert_equal "&lt;code&gt;command &amp;lt;filename&amp;gt;&lt;/code&gt;", @filter.xml_escape("<code>command &lt;filename&gt;</code>")
  end
  
end
{'fraction_non_alphanumeric': 0.11583514099783081, 'fraction_numerical': 0.012147505422993492, 'mean_word_length': 5.477528089887641, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4971061', 'n_tokens_mistral': 859, 'n_tokens_neox': 815, 'n_words': 153}