<commit_before>require File.expand_path('../test_helper.rb', __FILE__)

class SeriesExeTest < Test::Unit::TestCase
  include ShellTest

  def test_series_prints_usage
    output = `series`
    assert_match(/usage: series/, output)
  end

  def test_series_prints_values_for_series
    assert_script %{
      $ series geometric | head -n 5
      1.0
      2.0
      4.0
      8.0
      16.0
    }
  end

  #
  # -l, --list test
  #

  def test_list_option_shows_available_series
    %w{-l --list}.each do |opt|
      output = `series #{opt}`
      assert_match(/geometric/, output, opt)
    end
  end

  #
  # -n test
  #

  def test_n_option_limits_x
    assert_script %{
      $ series geometric -n 5
      1.0
      2.0
      4.0<commit_msg>Add test for passing args to series class<commit_after>require File.expand_path('../test_helper.rb', __FILE__)

class SeriesExeTest < Test::Unit::TestCase
  include ShellTest

  def test_series_prints_usage
    output = `series`
    assert_match(/usage: series/, output)
  end

  def test_series_prints_values_for_series
    assert_script %{
      $ series geometric | head -n 5
      1.0
      2.0
      4.0
      8.0
      16.0
    }
  end

  def test_series_passes_args_to_series
    assert_script %{
      $ series geometric 2 4 | head -n 5
      2.0
      8.0
      32.0
      128.0
      512.0
    }
  end

  #
  # -l, --list test
  #

  def test_list_option_shows_available_series
    %w{-l --list}.each do |opt|
      output = `series #{opt}`
      assert_match(/geometric/, output, opt)
    end
  end

  #
  # -n test
  #

  def test_n_option_limits_x
    assert_script %{
      $ series geometric -n 5
      1.0
      2.0
      4.0
{'fraction_non_alphanumeric': 0.09798099762470308, 'fraction_numerical': 0.0332541567695962, 'mean_word_length': 2.0470162748643763, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3272697', 'n_tokens_mistral': 626, 'n_tokens_neox': 593, 'n_words': 140}