<commit_before>require File.dirname(__FILE__) + '/spec_helper.rb'

class Module
  alias :has_constant? :const_defined?
end

describe Oniguruma, "::VERSION" do
  it "should have STRING" do
    Oniguruma::VERSION.should have_constant("STRING")
  end
  
  it "should have ENGINE" do
    Oniguruma::VERSION.should have_constant("ENGINE")
  end
end

describe Oniguruma, "::VERSION::STRING" do
  before(:each) do
    @version = Oniguruma::VERSION::STRING
  end
  
  it "should not be nil" do
    @version.should_not be_nil
  end
  
  it "should be x.y.z" do
    @version.should match(/([0-9]+\.){2}[0-9]+/)
  end
end

describe Oniguruma, "::VERSION::ENGINE" do
  before(:each) do
    @engine = Oniguruma::VERSION::ENGINE
  end
  
  it "should not be nil" do
    @engine.should_not be_nil
  end

  it "should be x.y.z" do
    @engine.should match(/([0-9]+\.){2}[0-9]+/)
  end
end

describe Oniguruma, "constants" do
  it "should have 'ENCODING_UNDEF'" do
    Oniguruma.should have_constant("ENCODING_UNDEF")
  end
  it "should have 'ENCODING_ASCII'" do
    Oniguruma.should have_constant("ENCODING_ASCII")
  end
  it "should have 'ENCODING_ISO_8859_1'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_1")
  end
  it "should have 'ENCODING_ISO_8859_2'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_2")
  end
  it "should have 'ENCODING_ISO_8859_3'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_3")
  end
  it "should have 'ENCODING_ISO_8859_4'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_4")
  end
  it "should have 'ENCODING_ISO_8859_5'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_5")
  end
  it "should have 'ENCODING_ISO_8859_6'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_6")
  end
  it "should have 'ENCODING_ISO_8859_7'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_7")
  end
  it "should have 'ENCODING_ISO_8859_8'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_8")
  end
  it "should have 'ENCODING_ISO_8859_9'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_9")
  end
  it "should have 'ENCODING_ISO_8859_10'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_10")
  end
  it "should have 'ENCODING_ISO_8859_11'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_11")
  end
  it "should have 'ENCODING_ISO_8859_13'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_13")
  end
  it "should have 'ENCODING_ISO_8859_14'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_14")
  end
  it "should have 'ENCODING_ISO_8859_15'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_15")
  end
  it "should have 'ENCODING_ISO_8859_16'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_16")
  end
  it "should have 'ENCODING_UTF8'" do
    Oniguruma.should have_constant("ENCODING_UTF8")
  end
  it "should have 'ENCODING_EUC_JP'" do
    Oniguruma.should have_constant("ENCODING_EUC_JP")
  end
  it "should have 'ENCODING_EUC_TW'" do
    Oniguruma.should have_constant("ENCODING_EUC_TW")
  end
  it "should have 'ENCODING_EUC_KR'" do
    Oniguruma.should have_constant("ENCODING_EUC_KR")
  end
  it "should have 'ENCODING_EUC_CN'" do
    Oniguruma.should have_constant("ENCODING_EUC_CN")
  end
  it "should have 'ENCODING_SJIS'" do
    Oniguruma.should have_constant("ENCODING_SJIS")
  end
  it "should have 'ENCODING_KOI8'" do
    Oniguruma.should have_constant("ENCODING_KOI8")
  end
  it "should have 'ENCODING_KOI8_R'" do
    Oniguruma.should have_constant("ENCODING_KOI8_R")
  end
  it "should have 'ENCODING_BIG5'" do
    Oniguruma.should have_constant("ENCODING_BIG5")
  end
  
  it "should have 'SYNTAX_DEFAULT'" do
    Oniguruma.should have_constant("SYNTAX_DEFAULT")
  end
  it "should have 'SYNTAX_POSIX_BASIC'" do
    Oniguruma.should have_constant("SYNTAX_POSIX_BASIC")
  end
  it "should have 'SYNTAX_POSIX_EXTENDED'" do
    Oniguruma.should have_constant("SYNTAX_POSIX_EXTENDED")
  end
  it "should have 'SYNTAX_EMACS'" do
    Oniguruma.should have_constant("SYNTAX_EMACS")
  end
  it "should have 'SYNTAX_GREP'" do
    Oniguruma.should have_constant("SYNTAX_GREP")
  end
  it "should have 'SYNTAX_GNU_REGEX'" do
    Oniguruma.should have_constant("SYNTAX_GNU_REGEX")
  end
  it "should have 'SYNTAX_JAVA'" do
    Oniguruma.should have_constant("SYNTAX_JAVA")
  end
  it "should have 'SYNTAX_PERL'" do
    Oniguruma.should have_constant("SYNTAX_PERL")
  end
  it "should have 'SYNTAX_RUBY'" do
    Oniguruma.should have_constant("SYNTAX_RUBY")
  end
  
  it "should have 'OPTION_DEFAULT'" do
    Oniguruma.should have_constant("OPTION_DEFAULT")
  end
  it "should have 'OPTION_NONE'" do
    Oniguruma.should have_constant("OPTION_NONE")
  end
  it "should have 'OPTION_IGNORECASE'" do
    Oniguruma.should have_constant("OPTION_IGNORECASE")
  end
  it "should have 'OPTION_EXTEND'" do
    Oniguruma.should have_constant("OPTION_EXTEND")
  end<commit_msg>Modify tests to handle conditional compilation rules<commit_after>require File.dirname(__FILE__) + '/spec_helper.rb'

class Module
  alias :has_constant? :const_defined?
end

describe Oniguruma, "::VERSION" do
  it "should have STRING" do
    Oniguruma::VERSION.should have_constant("STRING")
  end
  
  it "should have ENGINE" do
    Oniguruma::VERSION.should have_constant("ENGINE")
  end
end

describe Oniguruma, "::VERSION::STRING" do
  before(:each) do
    @version = Oniguruma::VERSION::STRING
  end
  
  it "should not be nil" do
    @version.should_not be_nil
  end
  
  it "should be x.y.z" do
    @version.should match(/([0-9]+\.){2}[0-9]+/)
  end
end

describe Oniguruma, "::VERSION::ENGINE" do
  before(:each) do
    @engine = Oniguruma::VERSION::ENGINE
  end
  
  it "should not be nil" do
    @engine.should_not be_nil
  end

  it "should be x.y.z" do
    @engine.should match(/([0-9]+\.){2}[0-9]+/)
  end
end

describe Oniguruma, "constants" do
  it "should have 'ENCODING_UNDEF'" do
    Oniguruma.should have_constant("ENCODING_UNDEF")
  end
  it "should have 'ENCODING_ASCII'" do
    Oniguruma.should have_constant("ENCODING_ASCII")
  end
  it "should have 'ENCODING_ISO_8859_1'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_1")
  end
  it "should have 'ENCODING_ISO_8859_2'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_2")
  end
  it "should have 'ENCODING_ISO_8859_3'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_3")
  end
  it "should have 'ENCODING_ISO_8859_4'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_4")
  end
  it "should have 'ENCODING_ISO_8859_5'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_5")
  end
  it "should have 'ENCODING_ISO_8859_6'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_6")
  end
  it "should have 'ENCODING_ISO_8859_7'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_7")
  end
  it "should have 'ENCODING_ISO_8859_8'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_8")
  end
  it "should have 'ENCODING_ISO_8859_9'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_9")
  end
  it "should have 'ENCODING_ISO_8859_10'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_10")
  end
  it "should have 'ENCODING_ISO_8859_11'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_11")
  end
  it "should have 'ENCODING_ISO_8859_13'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_13")
  end
  it "should have 'ENCODING_ISO_8859_14'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_14")
  end
  it "should have 'ENCODING_ISO_8859_15'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_15")
  end
  it "should have 'ENCODING_ISO_8859_16'" do
    Oniguruma.should have_constant("ENCODING_ISO_8859_16")
  end
  it "should have 'ENCODING_UTF8'" do
    Oniguruma.should have_constant("ENCODING_UTF8")
  end
  it "should have 'ENCODING_EUC_JP'" do
    Oniguruma.should have_constant("ENCODING_EUC_JP")
  end
  it "should have 'ENCODING_EUC_TW'" do
    Oniguruma.should have_constant("ENCODING_EUC_TW")
  end
  it "should have 'ENCODING_EUC_KR'" do
    Oniguruma.should have_constant("ENCODING_EUC_KR")
  end
  it "should have 'ENCODING_EUC_CN'" do
    Oniguruma.should have_constant("ENCODING_EUC_CN")
  end
  it "should have 'ENCODING_SJIS'" do
    Oniguruma.should have_constant("ENCODING_SJIS")
  end
  it "should have 'ENCODING_KOI8'" do
    if Oniguruma::VERSION::ENGINE.to_i != 4
      Oniguruma.should have_constant("ENCODING_KOI8")
    else
      Oniguruma.should_not have_constant("ENCODING_KOI8")
    end
  end
  it "should have 'ENCODING_KOI8_R'" do
    Oniguruma.should have_constant("ENCODING_KOI8_R")
  end
  it "should have 'ENCODING_BIG5'" do
    Oniguruma.should have_constant("ENCODING_BIG5")
  end
  it "should have 'ENCODING_UTF16_BE' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ENCODING_UTF16_BE")
    else
      Oniguruma.should_not have_constant("ENCODING_UTF16_BE")
    end
  end
  it "should have 'ENCODING_UTF16_BE' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ENCODING_UTF16_LE")
    else
      Oniguruma.should_not have_constant("ENCODING_UTF16_LE")
    end
  end
  it "should have 'ENCODING_UTF16_BE' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ENCODING_UTF32_BE")
    else
      Oniguruma.should_not have_constant("ENCODING_UTF32_BE")
    end
  end
  it "should have 'ENCODING_UTF16_BE' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ENCODING_UTF32_LE")
    else
      Oniguruma.should_not have_constant("ENCODING_UTF32_LE")
    end
  end
  it "should have 'ENCODING_UTF16_BE' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ENCODING_GB18030")
    else
      Oniguruma.should_not have_constant("ENCODING_GB18030")
    end
  end
  
  it "should have 'ENCODING_CP1251' for Engine >= 5" do
    if Oniguruma::VERSION::ENGINE.to_i >= 5
      Oniguruma.should have_constant("ENCODING_CP1251")
    else
      Oniguruma.should_not have_constant("ENCODING_CP1251")
    end
  end
  
  it "should have 'SYNTAX_DEFAULT'" do
    Oniguruma.should have_constant("SYNTAX_DEFAULT")
  end
  it "should have 'SYNTAX_POSIX_BASIC'" do
    Oniguruma.should have_constant("SYNTAX_POSIX_BASIC")
  end
  it "should have 'SYNTAX_POSIX_EXTENDED'" do
    Oniguruma.should have_constant("SYNTAX_POSIX_EXTENDED")
  end
  it "should have 'SYNTAX_EMACS'" do
    Oniguruma.should have_constant("SYNTAX_EMACS")
  end
  it "should have 'SYNTAX_GREP'" do
    Oniguruma.should have_constant("SYNTAX_GREP")
  end
  it "should have 'SYNTAX_GNU_REGEX'" do
    Oniguruma.should have_constant("SYNTAX_GNU_REGEX")
  end
  it "should have 'SYNTAX_JAVA'" do
    Oniguruma.should have_constant("SYNTAX_JAVA")
  end
  it "should have 'SYNTAX_PERL'" do
    Oniguruma.should have_constant("SYNTAX_PERL")
  end
  it "should have 'SYNTAX_RUBY'" do
    Oniguruma.should have_constant("SYNTAX_RUBY")
  end
  it "should have 'SYNTAX_PERL_NG' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("SYNTAX_PERL_NG")
    else
      Oniguruma.should_not have_constant("SYNTAX_PERL_NG")
    end
  end
  it "should have 'ONIG_SYNTAX_ASIS' for Engine >= 4" do
    if Oniguruma::VERSION::ENGINE.to_i >= 4
      Oniguruma.should have_constant("ONIG_SYNTAX_ASIS")
    else
      Oniguruma.should_not have_constant("ONIG_SYNTAX_ASIS")
    end
  end
  
  it "should have 'OPTION_DEFAULT'" do
    Oniguruma.should have_constant("OPTION_DEFAULT")
  end
  it "should have 'OPTION_NONE'" do
    Oniguruma.should have_constant("OPTION_NONE")
  end
  it "should have 'OPTION_IGNORECASE'" do
    Oniguruma.should have_constant("OPTION_IGNORECASE")
  end
  it "should have 'OPTION_EXTEND'" do
    Oniguruma.should have_constant("OPTION_EXTEND")
  end
{'fraction_non_alphanumeric': 0.09698800234919037, 'fraction_numerical': 0.03574125346086081, 'mean_word_length': 4.457875457875458, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 19, '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': '5180022', 'n_tokens_mistral': 5108, 'n_tokens_neox': 4514, 'n_words': 956}