<commit_before>require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "test_helper.rb"))

module Core
  module Array

    class MergingTest < ActiveSupport::TestCase
      test "translation class integrity" do
        assert_equal "Rich::I18n::Core::EnrichedString"                                                , "more".t.class.name
        assert_equal "String"                                                                          , "more users".t.class.name
        assert_equal ["Rich::I18n::Core::EnrichedString", "String", "Rich::I18n::Core::EnrichedString"], "more users".t.merged_strings.collect{|x| x.class.name}
      end

      test "single string" do
        assert_equal ""                                , [""].join(" ")
        assert_equal "String"                          , [""].join(" ").class.name
        assert_equal "more"                            , ["more".t].join(" ")
        assert_equal "Rich::I18n::Core::EnrichedString", ["more".t].join(" ").class.name
      end

      test "multiple strings" do
        assert_equal "String"                                                      , ["more".t, " ", "users".t].join(" ").class.name
        assert_equal [EnrichedString.new("more"), " ", EnrichedString.new("users")], ["more".t, " ", "users".t].join(" ").merged_strings

        # assert_equal "Meer gebruikers"                                                                       , "More users".t
        # assert_equal ["Meer", " ", "gebruikers"]                                                             , "More users".t.merged_strings
        # assert_equal nil                                                                                     , "More users".t.meta_data
        # assert_equal({:locale => :nl, :value => "meer", :derivative_key => "More", :key => "word.more"}      , "More users".t.merged_strings.first.meta_data)
        # assert_equal({:locale => :nl, :value => "gebruiker", :derivative_key => "users", :key => "word.user"}, "More users".t.merged_strings.last.meta_data)
        # assert_equal "één vraag"                                                                             , "One".t + " " + "question".t
        # assert_equal ["één", " ", "vraag"]                                                                   , ("One".t + " " + "question".t).merged_strings
      end
    end

  end
end<commit_msg>Cleaned up array/merging_test<commit_after>require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "test_helper.rb"))

module Core
  module Array

    class MergingTest < ActiveSupport::TestCase
      test "merged strings" do
        assert_equal ["hallo", " ", "world"], [                   "hallo"                    , " ", "world"].join.merged_strings
        assert_equal ["hallo", " ", "world"], [EnrichedString.new("hallo", {:key => "hello"}), " ", "world"].join.merged_strings
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.14912581419266369, 'fraction_numerical': 0.002742543709290367, 'mean_word_length': 1.5155172413793103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2541227', 'n_tokens_mistral': 782, 'n_tokens_neox': 742, 'n_words': 142}