<commit_before>require 'formula'

class Jq < Formula
  homepage 'http://stedolan.github.io/jq/'
  url 'http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz'
  sha1 'ac1f19e5d9921683af25251e97c2c4bfee895ca2'

  head do
    url 'https://github.com/stedolan/jq.git'

    depends_on 'autoconf' => :build
    depends_on 'automake' => :build
    depends_on 'libtool' => :build
    depends_on 'bison' => :build
  end

  def install
    system "autoreconf", "-iv" if build.head?
    system "./configure"
    system "make"
    bin.install 'jq'
    man1.install 'jq.1'
  end
end
<commit_msg>jq: add test<commit_after>require 'formula'

class Jq < Formula
  homepage 'http://stedolan.github.io/jq/'
  url 'http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz'
  sha1 'ac1f19e5d9921683af25251e97c2c4bfee895ca2'

  head do
    url 'https://github.com/stedolan/jq.git'

    depends_on 'autoconf' => :build
    depends_on 'automake' => :build
    depends_on 'libtool' => :build
    depends_on 'bison' => :build
  end

  def install
    system "autoreconf", "-iv" if build.head?
    system "./configure"
    system "make"
    bin.install 'jq'
    man1.install 'jq.1'
  end

  test do
    IO.popen("#{bin}/jq .bar", "w+") do |pipe|
      pipe.puts '{"foo":1, "bar":2}'
      pipe.close_write
      assert_equal "2\n", pipe.read
    end
  end
end

{'fraction_non_alphanumeric': 0.14839671886651754, 'fraction_numerical': 0.04548844146159582, 'mean_word_length': 3.005970149253731, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1011064', 'n_tokens_mistral': 566, 'n_tokens_neox': 530, 'n_words': 108}