<commit_before>require 'test/unit'
require 'tag_formatter'

class TagFormatterTest < Test::Unit::TestCase
  
  def test_default_parser
    input = "\n\n{test} #inline comment\n{test}/*multiline\nblockcomment*/{test2}{test3}\n{test4}+{unknowntest}"
    expected_output = "Hello, World!\nHello, World!Test 2...Test 3\nTest 4+{unknowntest}"
    my_tags = {
      test: "Hello, World!",
      test2: "Test 2...",
      test3: "Test 3",
      test4: "Test 4",
      unusedtest5: "Unused test 5"
    }
    options = {
      tags: my_tags
    }
    assert_equal expected_output,
      TagFormatter.new(input, options).parse!
  end

  def test_parser_with_options
    input = "\n\n%test% \/\/inline comment\n%test%(=multiline\nblockcomment=)%test2%%test3%\n%test4%+%unknowntest%"
    expected_output = "Hello, World!\nHello, World!Test 2...Test 3\nTest 4+%unknowntest%"
    my_tags = {
      test: "Hello, World!",
      test2: "Test 2...",
      test3: "Test 3",
      test4: "Test 4",
      unusedtest5: "Unused test 5"
    }
    options = {
      tags: my_tags,
      tag_start: '%',
      tag_end: '%',
      inline_comment_delimiter: '//',
      block_comment_start: '(=',
      block_comment_end: '=)'
    }
    assert_equal expected_output,
      TagFormatter.new(input, options).parse!
  end

end<commit_msg>Forgot to update test. Go me.<commit_after>require 'test/unit'
require 'tag_formatter'

class TagFormatterTest < Test::Unit::TestCase
  
  def test_default_parser
    input = "\n\n{test} #inline comment\n{test}/*multiline\nblockcomment*/{test2}{test3}\n{test4}+{unknowntest}"
    expected_output = "Hello, World!\nHello, World!Test 2...Test 3\nTest 4+{unknowntest}"
    my_tags = {
      test: "Hello, World!",
      test2: "Test 2...",
      test3: "Test 3",
      test4: "Test 4",
      unusedtest5: "Unused test 5"
    }
    options = {
      tags: my_tags
    }
    assert_equal expected_output,
      TagFormatter.new(input, options).parse
  end

  def test_parser_with_options
    input = "\n\n%test% \/\/inline comment\n%test%(=multiline\nblockcomment=)%test2%%test3%\n%test4%+%unknowntest%"
    expected_output = "Hello, World!\nHello, World!Test 2...Test 3\nTest 4+%unknowntest%"
    my_tags = {
      test: "Hello, World!",
      test2: "Test 2...",
      test3: "Test 3",
      test4: "Test 4",
      unusedtest5: "Unused test 5"
    }
    options = {
      tags: my_tags,
      tag_start: '%',
      tag_end: '%',
      inline_comment_delimiter: '//',
      block_comment_start: '(=',
      block_comment_end: '=)'
    }
    assert_equal expected_output,
      TagFormatter.new(input, options).parse
  end

end
{'fraction_non_alphanumeric': 0.15361216730038021, 'fraction_numerical': 0.02129277566539924, 'mean_word_length': 2.9035608308605343, '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': '2614756', 'n_tokens_mistral': 983, 'n_tokens_neox': 925, 'n_words': 182}