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

if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE'
  require 'bigdecimal'

  class MinimalAppTest < Test::Unit::TestCase
    def setup
      generate_app :excluded_stdlibs => %w{ant cgi digest dl drb ffi irb net optparse racc rbconfig rdoc rexml rinda rss
        rubygems runit shell soap test uri webrick win32 wsdl xmlrpc xsd ../1.9}
    end

    def teardown
      cleanup_app
    end

    def test_minimal_apk_is_less_than_3_mb
      apk_size = BigDecimal(File.size("#{APP_DIR}/bin/RubotoTestApp-debug.apk").to_s) / (1024 * 1024)
      upper_limit = {
          # '1.5.6' => 3.7,
          '1.6.7' => 3.2,
          '1.7.0.dev' => 3.5,
      }[JRUBY_JARS_VERSION.to_s] || 3.2
      lower_limit = upper_limit * 0.9
      version_message ="JRuby: #{JRUBY_JARS_VERSION}"<commit_msg>* Minimal standalone app for android-15 and JRuby 1.7.0.dev is now 3.8MB<commit_after>require File.expand_path("test_helper", File.dirname(__FILE__))

if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE'
  require 'bigdecimal'

  class MinimalAppTest < Test::Unit::TestCase
    def setup
      generate_app :excluded_stdlibs => %w{ant cgi digest dl drb ffi irb net optparse racc rbconfig rdoc rexml rinda rss
        rubygems runit shell soap test uri webrick win32 wsdl xmlrpc xsd ../1.9}
    end

    def teardown
      cleanup_app
    end

    def test_minimal_apk_is_less_than_3_mb
      apk_size = BigDecimal(File.size("#{APP_DIR}/bin/RubotoTestApp-debug.apk").to_s) / (1024 * 1024)
      upper_limit = {
          # '1.5.6' => 3.7,
          '1.6.7' => 3.2,
          '1.7.0.dev' => 3.8,
      }[JRUBY_JARS_VERSION.to_s] || 3.2
      lower_limit = upper_limit * 0.9
      version_message ="JRuby: #{JRUBY_JARS_VERSION}"
{'fraction_non_alphanumeric': 0.11579539066891512, 'fraction_numerical': 0.039910061832490164, 'mean_word_length': 2.964365256124722, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1427939', 'n_tokens_mistral': 733, 'n_tokens_neox': 658, 'n_words': 146}