<commit_before>require 'test_helper'

class CompressorsTest < ActiveSupport::TestCase
  setup do
    @compressor = Emcee::Compressors::HtmlCompressor.new
  end

  test "compressor should remove html comments" do
    content = %q{
      <!--
        What will we do with all
        of these html comments?
      -->
      <span>The span to end all spans</span>
    }
    assert_equal "\n" + @compressor.compress(content), %q{
      <span>The span to end all spans</span>
    }
  end

  test "compressor should remove multi-line javascript comments" do
    content = %q{
      <script>
        /*
        Here are some comments that
        go over many, many lines.
        */
      </script>
    }
    assert_equal "\n" + @compressor.compress(content), %q{
      <script>
      </script>
    }
  end

  test "compressor should remove single-line javascript comments" do<commit_msg>Remove forgotten module designation in test<commit_after>require 'test_helper'

class CompressorsTest < ActiveSupport::TestCase
  setup do
    @compressor = Emcee::HtmlCompressor.new
  end

  test "compressor should remove html comments" do
    content = %q{
      <!--
        What will we do with all
        of these html comments?
      -->
      <span>The span to end all spans</span>
    }
    assert_equal "\n" + @compressor.compress(content), %q{
      <span>The span to end all spans</span>
    }
  end

  test "compressor should remove multi-line javascript comments" do
    content = %q{
      <script>
        /*
        Here are some comments that
        go over many, many lines.
        */
      </script>
    }
    assert_equal "\n" + @compressor.compress(content), %q{
      <script>
      </script>
    }
  end

  test "compressor should remove single-line javascript comments" do
{'fraction_non_alphanumeric': 0.09882088714205503, 'fraction_numerical': 0.0, 'mean_word_length': 2.337078651685393, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '7116583', 'n_tokens_mistral': 537, 'n_tokens_neox': 515, 'n_words': 170}