<commit_before>#!/bin/bash -e

. ./test/test_helper.sh
. ./support/git-functions.sh
. ./support/changelog-functions.sh

describe "git-release - unit - changelog"

after() {
  if [[ $MAINTAIN_SANDBOX != true ]]; then
    remove_sandbox
  fi;
}

#escape_newlines

it_uses_escape_newlines_to_replace_all_newlines_in_single_line_string(){
  local commit_message="Some single line"

  output=$(escape_newlines "$commit_message")

  test "$output" = "${commit_message}"
}

it_uses_escape_newlines_to_replace_all_newlines_in_multiline_string(){
  local commit_message="Some line with
with values
across multiple lines
and trailing
"

  output=$(escape_newlines "$commit_message")

  test "$output" = "Some line with<#new_line#>with values<#new_line#>across multiple lines<#new_line#>and trailing<#new_line#>"
}

unescape_newlines

it_uses_unescape_newlines_to_replace_all_wildcards_in_string_with_no_wildcards(){
  local commit_message="Unescaped single line"

  output=$(unescape_newlines "$commit_message")

  test "$output" = "${commit_message}"
}
it_uses_unescape_newlines_to_replace_all_wildcards_in_string_with_newlines_when_multiple_exist(){
  local commit_message="Some line with<#new_line#>with values<#new_line#>across multiple lines<#new_line#>and trailing<#new_line#>"<commit_msg>Comment out line correctly<commit_after>#!/bin/bash -e

. ./test/test_helper.sh
. ./support/git-functions.sh
. ./support/changelog-functions.sh

describe "git-release - unit - changelog"

after() {
  if [[ $MAINTAIN_SANDBOX != true ]]; then
    remove_sandbox
  fi;
}

#escape_newlines

it_uses_escape_newlines_to_replace_all_newlines_in_single_line_string(){
  local commit_message="Some single line"

  output=$(escape_newlines "$commit_message")

  test "$output" = "${commit_message}"
}

it_uses_escape_newlines_to_replace_all_newlines_in_multiline_string(){
  local commit_message="Some line with
with values
across multiple lines
and trailing
"

  output=$(escape_newlines "$commit_message")

  test "$output" = "Some line with<#new_line#>with values<#new_line#>across multiple lines<#new_line#>and trailing<#new_line#>"
}

#unescape_newlines

it_uses_unescape_newlines_to_replace_all_wildcards_in_string_with_no_wildcards(){
  local commit_message="Unescaped single line"

  output=$(unescape_newlines "$commit_message")

  test "$output" = "${commit_message}"
}
it_uses_unescape_newlines_to_replace_all_wildcards_in_string_with_newlines_when_multiple_exist(){
  local commit_message="Some line with<#new_line#>with values<#new_line#>across multiple lines<#new_line#>and trailing<#new_line#>"
{'fraction_non_alphanumeric': 0.11493808049535603, 'fraction_numerical': 0.0, 'mean_word_length': 7.447712418300654, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2872934', 'n_tokens_mistral': 923, 'n_tokens_neox': 894, 'n_words': 142}