<commit_before>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class HeapEmacs < EmacsFormula
  desc "Emacs implementation of the ternary heap data structure"
  homepage "http://www.dr-qubit.org/emacs.php"
  url "http://www.dr-qubit.org/download.php?file=predictive/heap-0.4.el"
  sha256 "e6394912f111d9ee09b1005a69f08e37f18dae7e0b19d8728217f4bc37b06fef"

  depends_on :emacs

  def install
    mv "heap-#{version}.el", "heap.el"
    byte_compile "heap.el"
    (share/"emacs/site-lisp/heap-emacs").install "heap.el", "heap.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{HOMEBREW_PREFIX}/share/emacs/site-lisp")
      (load "heap")
      (print (minibuffer-prompt-width))
    EOS
    assert_equal "0", shell_output("emacs -batch -l #{testpath}/test.el").strip
  end
end<commit_msg>heap-emacs: fix install dir and test<commit_after>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class HeapEmacs < EmacsFormula
  desc "Emacs implementation of the ternary heap data structure"
  homepage "http://www.dr-qubit.org/emacs.php"
  url "http://www.dr-qubit.org/download.php?file=predictive/heap-0.4.el"
  sha256 "e6394912f111d9ee09b1005a69f08e37f18dae7e0b19d8728217f4bc37b06fef"

  depends_on :emacs

  def install
    mv "heap-#{version}.el", "heap.el"
    byte_compile "heap.el"
    (share/"emacs/site-lisp/heap").install "heap.el", "heap.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{share}/emacs/site-lisp/heap")
      (load "heap")
      (print (minibuffer-prompt-width))
    EOS
    assert_equal "0", shell_output("emacs -Q --batch -l #{testpath}/test.el").strip
  end
end
{'fraction_non_alphanumeric': 0.15326340326340326, 'fraction_numerical': 0.054778554778554776, 'mean_word_length': 3.7827298050139277, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1031319', 'n_tokens_mistral': 728, 'n_tokens_neox': 670, 'n_words': 113}