<commit_before>require File.dirname(__FILE__) + '/helper'

class TestActor < Test::Unit::TestCase
  def setup

  end

  # output
  def test_output_adds_tz_offset
    t = Time.now
    a = Actor.new("<NAME>", "<EMAIL>")
    assert_equal "<NAME> <<EMAIL>> #{t.to_i} -0700", 
      a.output(t)
  end

  # from_string

  def test_from_string_should_separate_name_and_email
    a = Actor.from_string("<NAME> <<EMAIL>>")
    assert_equal "<NAME>", a.name
    assert_equal "<EMAIL>", a.email
  end

  def test_from_string_should_handle_just_name
    a = Actor.from_string("<NAME>")
    assert_equal "<NAME>", a.name<commit_msg>less fragile actor output test<commit_after>require File.dirname(__FILE__) + '/helper'

class TestActor < Test::Unit::TestCase
  def setup

  end

  # output
  def test_output_adds_tz_offset
    t = Time.now
    a = Actor.new("<NAME>", "<EMAIL>")
    pieces = a.output(t).split(" ")
    offset = pieces.pop
    output = pieces * ' '
    assert_equal "<NAME> <<EMAIL>> #{t.to_i}", output
    assert_match /-?\d{4}/, offset
  end

  # from_string

  def test_from_string_should_separate_name_and_email
    a = Actor.from_string("<NAME> <<EMAIL>>")
    assert_equal "<NAME>", a.name
    assert_equal "<EMAIL>", a.email
  end

  def test_from_string_should_handle_just_name
    a = Actor.from_string("<NAME>")
    assert_equal "<NAME>", a.name
{'fraction_non_alphanumeric': 0.14212076583210603, 'fraction_numerical': 0.003681885125184094, 'mean_word_length': 3.7517482517482517, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 27, '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': '2085557', 'n_tokens_mistral': 489, 'n_tokens_neox': 472, 'n_words': 99}