<commit_before>Code.require_file "../test_helper", __FILE__

defmodule StringTest do
  use ExUnit::Case

  test :double_quoted_heredoc do
    assert_equal 7, __LINE__
    assert_equal "foo\nbar\n", """
foo
bar
"""

    assert_equal 13, __LINE__
    assert_equal "foo\nbar \"\"\"\n", """
foo
bar """
"""
  end

  test :single_quoted_heredoc do
    assert_equal 21, __LINE__
    assert_equal 'foo\nbar\n', '''
foo
bar
'''

    assert_equal 27, __LINE__
    assert_equal 'foo\nbar \'\'\'\n', '''
foo
bar '''
'''
  end

  test :string_concatenation_as_match do
    "foo" <> x = "foobar"
    assert_equal "bar", x
  end
end<commit_msg>Assert heredocs accept expressions after its declaration<commit_after>Code.require_file "../test_helper", __FILE__

defmodule StringTest do
  use ExUnit::Case

  test :double_quoted_heredoc do
    assert_equal 7, __LINE__
    assert_equal "foo\nbar\n", """
foo
bar
"""

    assert_equal 13, __LINE__
    assert_equal "foo\nbar \"\"\"\n", """
foo
bar """
"""
  end

  test :single_quoted_heredoc do
    assert_equal 21, __LINE__
    assert_equal 'foo\nbar\n', '''
foo
bar
'''

    assert_equal 27, __LINE__
    assert_equal 'foo\nbar \'\'\'\n', '''
foo
bar '''
'''
  end

  test :double_quoted_heredoc_with_extra do
    assert_equal 35, __LINE__
    assert_equal "foo\nbar\nbar\n", """ <> "bar\n"
foo
bar
"""
  end

  test :string_concatenation_as_match do
    "foo" <> x = "foobar"
    assert_equal "bar", x
  end
end
{'fraction_non_alphanumeric': 0.13890808569454044, 'fraction_numerical': 0.0110573600552868, 'mean_word_length': 3.3746223564954683, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6690484', 'n_tokens_mistral': 571, 'n_tokens_neox': 531, 'n_words': 131}