<commit_before>Code.require_file("../test_helper.exs", __DIR__)

defmodule IEx.PryTest do
  use ExUnit.Case

  setup do
    on_exit(fn -> IEx.Pry.remove_breaks() end)
  end

  describe "whereami" do
    test "shows lines with radius" do
      Application.put_env(:elixir, :ansi_enabled, true)

      {:ok, contents} = IEx.Pry.whereami(__ENV__.file, 3, 2)

      assert IO.iodata_to_binary(contents) == """
                 1: Code.require_file "../test_helper.exs", __DIR__
                 2:\s
             \e[1m    3: defmodule IEx.PryTest do
             \e[22m    4:   use ExUnit.Case
                 5:\s
             """

      {:ok, contents} = IEx.Pry.whereami(__ENV__.file, 1, 4)

      assert IO.iodata_to_binary(contents) == """
             \e[1m    1: Code.require_file "../test_helper.exs", __DIR__
             \e[22m    2:\s<commit_msg>Fix the build for IEx pry tests<commit_after>Code.require_file("../test_helper.exs", __DIR__)

defmodule IEx.PryTest do
  use ExUnit.Case

  setup do
    on_exit(fn -> IEx.Pry.remove_breaks() end)
  end

  describe "whereami" do
    test "shows lines with radius" do
      Application.put_env(:elixir, :ansi_enabled, true)

      {:ok, contents} = IEx.Pry.whereami(__ENV__.file, 3, 2)

      assert IO.iodata_to_binary(contents) == """
                 1: Code.require_file("../test_helper.exs", __DIR__)
                 2:\s
             \e[1m    3: defmodule IEx.PryTest do
             \e[22m    4:   use ExUnit.Case
                 5:\s
             """

      {:ok, contents} = IEx.Pry.whereami(__ENV__.file, 1, 4)

      assert IO.iodata_to_binary(contents) == """
             \e[1m    1: Code.require_file("../test_helper.exs", __DIR__)
             \e[22m    2:\s
{'fraction_non_alphanumeric': 0.13310185185185186, 'fraction_numerical': 0.019675925925925927, 'mean_word_length': 1.9656946826758148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2203514', 'n_tokens_mistral': 639, 'n_tokens_neox': 608, 'n_words': 125}