<commit_before>require 'rails_helper'

describe 'Mysql Types' do
  it 'returns the expected native types' do
    native_types = ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES.keys.map &:to_s

    expect(native_types.length).to eq 11
    expect(native_types.sort).to eq [ "binary", "boolean", "date", "datetime", "decimal", "float", "integer", "primary_key", "string", "text", "time" ]
  end

  it 'supports the following types' do
    supporting_types = AllMysqlType.connection.type_map.try do |type_map|
      type_map.instance_variable_get('@mapping').keys.map do |key|
        key.source.gsub %r(\^|(\\.*\Z)), ''
      end.compact.uniq
    end

    expect(supporting_types.length).to eq 30
    expect(supporting_types.sort).to eq [ "bigint", "binary", "bit", "blob", "boolean", "char", "clob", "date", "datetime", "decimal", "double", "enum", "float", "int", "longblob", "longtext", "mediumblob", "mediumint", "mediumtext", "number", "numeric", "set", "smallint", "text", "time", "timestamp", "tinyblob", "tinyint", "tinytext", "year" ]
  end<commit_msg>update mysql_types_spec<commit_after>require 'rails_helper'

describe 'Mysql Types' do
  it 'returns the expected native types' do
    native_types = ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES.keys.map &:to_s

    expect(native_types.length).to eq 12
    expect(native_types.sort).to eq [ "binary", "boolean", "date", "datetime", "decimal", "float", "integer", "json", "primary_key", "string", "text", "time" ]
  end

  it 'supports the following types' do
    supporting_types = AllMysqlType.connection.type_map.try do |type_map|
      type_map.instance_variable_get('@mapping').keys.map do |key|
        key.source.gsub %r(\^|(\\.*\Z)), ''
      end.compact.uniq
    end

    expect(supporting_types.length).to eq 31
    expect(supporting_types.sort).to eq [ "bigint", "binary", "bit", "blob", "boolean", "char", "clob", "date", "datetime", "decimal", "double", "enum", "float", "int", "json", "longblob", "longtext", "mediumblob", "mediumint", "mediumtext", "number", "numeric", "set", "smallint", "text", "time", "timestamp", "tinyblob", "tinyint", "tinytext", "year" ]
  end
{'fraction_non_alphanumeric': 0.18346957311534967, 'fraction_numerical': 0.0036330608537693005, 'mean_word_length': 5.153631284916201, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4026898', 'n_tokens_mistral': 758, 'n_tokens_neox': 737, 'n_words': 174}