<commit_before>
if respond_to?(:require_relative, true)
  require_relative 'abstract'
else
  require File.dirname(__FILE__) + '/abstract'
end

TestCase = begin
             require 'minitest/unit'
             MiniTest::Unit.autorun
             MiniTest::Unit::TestCase
           rescue LoadError
             require 'test/unit'
             Test::Unit::TestCase
           end

%w[sqlite mysql postgres].each{ |adapter|
  begin
    require "dm-#{adapter}-adapter"
  rescue LoadError
    puts "skip #{adapter} test since it's not installed"
  end
}

# cost 1 second to run
class SqliteTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'sqlite::memory:')
  end
end if defined?(DataMapper::Adapters::SqliteAdapter)


# cost 2 seconds to run
class MysqlTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'mysql://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::MysqlAdapter)


# cost 3 seconds to run
class PostgresTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'postgres://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::PostgresAdapter)
<commit_msg>introduce setup with hash test with sqlite adapter<commit_after>
if respond_to?(:require_relative, true)
  require_relative 'abstract'
else
  require File.dirname(__FILE__) + '/abstract'
end

TestCase = begin
             require 'minitest/unit'
             MiniTest::Unit.autorun
             MiniTest::Unit::TestCase
           rescue LoadError
             require 'test/unit'
             Test::Unit::TestCase
           end

%w[sqlite mysql postgres].each{ |adapter|
  begin
    require "dm-#{adapter}-adapter"
  rescue LoadError
    puts "skip #{adapter} test since it's not installed"
  end
}

# cost 1 second to run
class SqliteTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'sqlite::memory:')

  end
end if defined?(DataMapper::Adapters::SqliteAdapter)

class SqliteHashSetupTest < TestCase
  include Abstract
  def setup_data_mapper
    DataMapper.setup(:default, :adapter => 'sqlite', :database => ':memory:')
  end
end if defined?(DataMapper::Adapters::SqliteAdapter)

# cost 2 seconds to run
class PostgresTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'postgres://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::PostgresAdapter)

# cost 8 seconds to run (what the hell??)
class MysqlTest < TestCase
  include Abstract

  def setup_data_mapper
    DataMapper.setup(:default, 'mysql://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::MysqlAdapter)

{'fraction_non_alphanumeric': 0.0950354609929078, 'fraction_numerical': 0.002127659574468085, 'mean_word_length': 3.9232111692844676, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 5, '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': '4985889', 'n_tokens_mistral': 869, 'n_tokens_neox': 856, 'n_words': 216}