<commit_before>require 'formula'

class TokyoDystopia < Formula
  homepage 'http://fallabs.com/tokyodystopia/'
  url 'http://fallabs.com/tokyodystopia/tokyodystopia-0.9.15.tar.gz'
  sha1 '525a44e517ca9594d28fed111e2d103fe6fbf440'

  depends_on 'tokyo-cabinet'

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make"
    system "make install"
  end<commit_msg>tokyo-dystopia: test added<commit_after>class TokyoDystopia < Formula
  homepage "http://fallabs.com/tokyodystopia/"
  url "http://fallabs.com/tokyodystopia/tokyodystopia-0.9.15.tar.gz"
  sha256 "28b43c592a127d1c9168eac98f680aa49d1137b4c14b8d078389bbad1a81830a"

  depends_on "tokyo-cabinet"

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make"
    system "make", "check"
    system "make", "install"
  end

  test do
    (testpath/"test.tsv").write <<-EOS.undent
      1\tUnited States
      55\tBrazil
      81\tJapan
    EOS

    system "#{bin}/dystmgr", "importtsv", "casket", "test.tsv"
    system "#{bin}/dystmgr", "put", "casket", "83", "China"
    system "#{bin}/dystmgr", "list", "-pv", "casket"
  end
{'fraction_non_alphanumeric': 0.15178571428571427, 'fraction_numerical': 0.07678571428571429, 'mean_word_length': 3.811158798283262, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '2067122', 'n_tokens_mistral': 503, 'n_tokens_neox': 443, 'n_words': 76}