<commit_before>#! /bin/sh

readonly BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${BASE}/run.sh"

test_determine_project_home() {
  local project_home

  PROJECT_HOME="/tmp"
  determine_project_home "/foo"
  assertEquals "/tmp" "${project_home}"
  unset PROJECT_HOME
  
  determine_project_home "/tmp"
  assertEquals "/tmp" "${project_home}"

  determine_project_home "../"
  assertNotNull "${project_home}"
  assertEquals "/" "${project_home:0:1}"
}

test_check_env_vars_options() {
  local baseline_group=""
  local packages
  local force_update
  local builder_ci_fallback
  local run_script
  local excluded_categories
  local excluded_classes
  local keep_open

  BASELINE_GROUP="foo1"
  PACKAGES="foo2"
  FORCE_UPDATE="false"
  BUILDERCI="true"
  RUN_SCRIPT="foo.st"
  EXCLUDE_CATEGORIES="foo3"
  EXCLUDE_CLASSES="foo4"<commit_msg>Fix test<commit_after>#! /bin/sh

readonly BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${BASE}/run.sh"

test_determine_project_home() {
  local project_home

  PROJECT_HOME_ORIGINAL="${PROJECT_HOME}"

  [[ -z "${PROJECT_HOME}" ]] && PROJECT_HOME="/tmp"
  determine_project_home "/foo"
  assertEquals "${PROJECT_HOME}" "${project_home}"

  unset PROJECT_HOME
  determine_project_home "/tmp"
  assertEquals "/tmp" "${project_home}"

  determine_project_home "../"
  assertNotNull "${project_home}"
  assertEquals "/" "${project_home:0:1}"

  [[ -n "${PROJECT_HOME_ORIGINAL}" ]] \
      && export PROJECT_HOME="${PROJECT_HOME_ORIGINAL}"

  return 0
}

test_check_env_vars_options() {
  local baseline_group=""
  local packages
  local force_update
  local builder_ci_fallback
  local run_script
  local excluded_categories
  local excluded_classes
  local keep_open

  BASELINE_GROUP="foo1"
  PACKAGES="foo2"
  FORCE_UPDATE="false"
  BUILDERCI="true"
  RUN_SCRIPT="foo.st"
  EXCLUDE_CATEGORIES="foo3"
  EXCLUDE_CLASSES="foo4"
{'fraction_non_alphanumeric': 0.1417281348788198, 'fraction_numerical': 0.007903055848261328, 'mean_word_length': 5.267326732673268, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2052620', 'n_tokens_mistral': 699, 'n_tokens_neox': 671, 'n_words': 117}