<commit_before>require 'minitest/autorun'
require_relative 'anagram'

class AnagramTest < MiniTest::Unit::TestCase

  def test_no_matches
    detector = Anagram.new('diaper')
    assert_equal [], detector.match(%w(hello world zombies pants))
  end

  def test_detect_simple_anagram
    skip
    detector = Anagram.new('ant')
    anagrams = detector.match(['tan', 'stand', 'at'])
    assert_equal ['tan'], anagrams
  end

  def test_detect_multiple_anagrams
    skip
    detector = Anagram.new('master')
    anagrams = detector.match(['stream', 'pigeon', 'maters'])
    assert_equal ['maters', 'stream'], anagrams.sort
  end

  def test_does_not_confuse_different_duplicates
    skip
    detector = Anagram.new('galea')
    assert_equal [], detector.match(['eagle'])
  end

  def test_identical_word_is_not_anagram
    skip
    detector = Anagram.new('corn')
    anagrams = detector.match %w(corn dark Corn rank CORN park)
    assert_equal [], anagrams
  end

  def test_eliminate_anagrams_with_same_checksum
    skip
    detector = Anagram.new('mass')
    assert_equal [], detector.match(['last'])
  end

  def test_eliminate_anagram_subsets
    skip
    detector = Anagram.new('good')
    assert_equal [], detector.match(['dog', 'goody'])
  end
<commit_msg>Catch potential bug in anagram<commit_after>require 'minitest/autorun'
require_relative 'anagram'

class AnagramTest < MiniTest::Unit::TestCase

  def test_no_matches
    detector = Anagram.new('diaper')
    assert_equal [], detector.match(%w(hello world zombies pants))
  end

  def test_detect_simple_anagram
    skip
    detector = Anagram.new('ant')
    anagrams = detector.match(['tan', 'stand', 'at'])
    assert_equal ['tan'], anagrams
  end

  def test_detect_multiple_anagrams
    skip
    detector = Anagram.new('master')
    anagrams = detector.match(['stream', 'pigeon', 'maters'])
    assert_equal ['maters', 'stream'], anagrams.sort
  end

  def test_does_not_confuse_different_duplicates
    skip
    detector = Anagram.new('galea')
    assert_equal [], detector.match(['eagle'])
  end

  def test_identical_word_is_not_anagram
    skip
    detector = Anagram.new('corn')
    anagrams = detector.match %w(corn dark Corn rank CORN cron park)
    assert_equal ['cron'], anagrams
  end

  def test_eliminate_anagrams_with_same_checksum
    skip
    detector = Anagram.new('mass')
    assert_equal [], detector.match(['last'])
  end

  def test_eliminate_anagram_subsets
    skip
    detector = Anagram.new('good')
    assert_equal [], detector.match(['dog', 'goody'])
  end

{'fraction_non_alphanumeric': 0.11635220125786164, 'fraction_numerical': 0.0, 'mean_word_length': 4.131048387096774, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3299330', 'n_tokens_mistral': 854, 'n_tokens_neox': 846, 'n_words': 176}