<commit_before>require 'minitest/autorun'

class TestExpand < Minitest::Test
  CFLAGS = "-std=c99 -Wall"
  `cc #{CFLAGS} expand.c -o expand.out`

  def test_basic_usage
    output1 = `./expand.out test_text/text1.txt`
    assert_equal `cat test_text/expanded_text1.txt`, output1

    output2 = `./expand.out test_text/text2.txt`
    assert_equal `cat test_text/expanded_text2.txt`, output2
  end

  def test_non_english
    output = `./expand.out test_text/text3.txt`
    assert_equal `cat test_text/expanded_text3.txt`, output
  end

  def test_option_t
    output1 = `./expand.out -t 6 test_text/text1.txt`
    output2 = `./expand.out test_text/text1.txt -t 6`
    assert_equal `cat test_text/expanded_6_text1.txt`, output1
    assert_equal `cat test_text/expanded_6_text1.txt`, output2

    output3 = `./expand.out -t 6 test_text/text3.txt`
    output4 = `./expand.out test_text/text3.txt -t 6`
    assert_equal `cat test_text/expanded_6_text3.txt`, output3
    assert_equal `cat test_text/expanded_6_text3.txt`, output4
  end
end<commit_msg>Rewrite test<commit_after>require 'minitest/autorun'

class TestExpand < Minitest::Test
  CFLAGS = "-std=c99 -Wall"
  `cc #{CFLAGS} expand.c -o expand.out`

  def test_basic_usage
    output1 = `./expand.out test_text/text1.txt`
    assert_equal IO.read("test_text/expanded_text1.txt"), output1

    output2 = `./expand.out test_text/text2.txt`
    assert_equal IO.read("test_text/expanded_text2.txt"), output2
  end

  def test_non_english
    output = `./expand.out test_text/text3.txt`
    assert_equal IO.read("test_text/expanded_text3.txt"), output
  end

  def test_option_t
    output1 = `./expand.out -t 6 test_text/text1.txt`
    assert_equal IO.read("test_text/expanded_6_text1.txt"), output1

    output2 = `./expand.out -t 6 test_text/text3.txt`
    assert_equal IO.read("test_text/expanded_6_text3.txt"), output2
  end
end
{'fraction_non_alphanumeric': 0.11861702127659575, 'fraction_numerical': 0.031914893617021274, 'mean_word_length': 3.7025, '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': '5943097', 'n_tokens_mistral': 728, 'n_tokens_neox': 707, 'n_words': 137}