<commit_before>#!/bin/sh


# Tests the 'xeno config' command


oneTimeSetUp()
{
  # Set the XENO_CONFIGURATION_PATH environment variable so that we don't
  # pollute the user's actual configuration file
  export XENO_CONFIGURATION_FILE="/tmp/xeno.conf"
}


testExitCodes()
{
  # Check that running without any help flag results in an error exit code
  xeno config > /dev/null 2>&1
  result=$?
  assertEquals "xeno config by itself should exit with code 0" 0 ${result}


  # Check that running with a short help flag results in a non-error exit code
  xeno config -h > /dev/null 2>&1
  result=$?
  assertEquals "xeno config with -h should exit with code 0" 0 ${result}<commit_msg>Refactored setup/teardown for config test.<commit_after>#!/bin/sh


# Tests the 'xeno config' command


setUp()
{
  # Create a directory (which we can easily remove) which will contain all of
  # our testing content
  TEST_PATH="/tmp/xeno-test"
  mkdir "$TEST_PATH"

  # We override the standard xeno configuration file location so that we don't
  # clobber the user's configuration (note that this needs to be exported to
  # propagate to xeno commands)
  export XENO_CONFIGURATION_FILE="$TEST_PATH/xeno.conf"
}


tearDown()
{
  # Remove the testing directory
  rm -rf "$TEST_PATH"

  # Unset the configuration file (needed for xeno commands to work at beginning
  # of next setUp)
  unset XENO_CONFIGURATION_FILE
}


testExitCodes()
{
  # Check that running without any help flag results in an error exit code
  xeno config > /dev/null 2>&1
  result=$?
  assertEquals "xeno config by itself should exit with code 0" 0 ${result}


  # Check that running with a short help flag results in a non-error exit code
  xeno config -h > /dev/null 2>&1
  result=$?
  assertEquals "xeno config with -h should exit with code 0" 0 ${result}
{'fraction_non_alphanumeric': 0.08130530973451328, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 3.824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7533180', 'n_tokens_mistral': 579, 'n_tokens_neox': 545, 'n_words': 234}