<commit_before>require 'minitest/autorun'
require 'pathname'
require 'json'

class TestIntegration < Minitest::Test
  def test_parsing
    exec_path = Pathname(__dir__).join("../../out")
    input = '{"source": {}, "params": {"file": "foo"}}'
    output = `echo '#{input}' | #{exec_path} bar 2>&1`

    assert_match /NoGlobMatches/, output
  end

  def test_in_echos_version
    exec_path = Pathname(__dir__).join("../../in")
    input = JSON.generate(
      "source" => { "" => "" },
      "version" => {
        "mynumber" => "3.6.x"
      }
    )
    output = `echo '#{input}' | #{exec_path} somedestination 2>&1`

    assert_equal(
      {"version" => {"mynumber" => "3.6.x"}},
      JSON.parse(output)<commit_msg>Rename fast integration test<commit_after>require 'minitest/autorun'
require 'pathname'
require 'json'

class TestFastIntegration < Minitest::Test
  def test_parsing
    exec_path = Pathname(__dir__).join("../../out")
    input = '{"source": {}, "params": {"file": "foo"}}'
    output = `echo '#{input}' | #{exec_path} bar 2>&1`

    assert_match /NoGlobMatches/, output
  end

  def test_in_echos_version
    exec_path = Pathname(__dir__).join("../../in")
    input = JSON.generate(
      "source" => { "" => "" },
      "version" => {
        "mynumber" => "3.6.x"
      }
    )
    output = `echo '#{input}' | #{exec_path} somedestination 2>&1`

    assert_equal(
      {"version" => {"mynumber" => "3.6.x"}},
      JSON.parse(output)
{'fraction_non_alphanumeric': 0.19931271477663232, 'fraction_numerical': 0.010996563573883162, 'mean_word_length': 3.0444444444444443, 'pattern_counts': {'":': 6, '<': 5, '<?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': '6249187', 'n_tokens_mistral': 524, 'n_tokens_neox': 512, 'n_words': 100}