<commit_before>#! /bin/sh
# vim:et:ft=sh:sts=2:sw=2
#
# shUnit2 unit tests for general commands.
#
# Copyright 2008-2021 <NAME>. All Rights Reserved.
# Released under the Apache 2.0 license.
#
# Author: <EMAIL> (<NAME>)
# https://github.com/kward/shunit2
#
### ShellCheck http://www.shellcheck.net/
# $() are not fully portable (POSIX != portable).
#   shellcheck disable=SC2006
# Disable source following.
#   shellcheck disable=SC1090,SC1091
# Not wanting to escape single quotes.
#   shellcheck disable=SC1003

# These variables will be overridden by the test helpers.
stdoutF="${TMPDIR:-/tmp}/STDOUT"
stderrF="${TMPDIR:-/tmp}/STDERR"

# Load test helpers.
. ./shunit2_test_helpers

testSkipping() {
  # We shouldn't be skipping to start.
  if isSkipping; then
    th_error 'skipping *should not be* enabled'
    return
  fi

  startSkipping
  isSkipping; was_skipping_started=$?
  endSkipping
  isSkipping; was_skipping_ended=$?

  assertEquals "skipping wasn't started" ${was_skipping_started} "${SHUNIT_TRUE}"
  assertNotEquals "skipping wasn't ended" ${was_skipping_ended} "${SHUNIT_TRUE}"
  return 0
}

testStartSkippingWithMessage() {
  unittestF="${SHUNIT_TMPDIR}/unittest"
  sed 's/^#//' >"${unittestF}" <<\EOF
## Start skipping with a message.
#testSkipping() {
#  startSkipping 'SKIP-a-Dee-Doo-Dah'
#}
#SHUNIT_COLOR='none'
#. ${TH_SHUNIT}
EOF<commit_msg>Fix `set -e` issues caught by mksh shell.<commit_after>#! /bin/sh
# vim:et:ft=sh:sts=2:sw=2
#
# shUnit2 unit tests for general commands.
#
# Copyright 2008-2021 <NAME>. All Rights Reserved.
# Released under the Apache 2.0 license.
#
# Author: <EMAIL> (<NAME>)
# https://github.com/kward/shunit2
#
### ShellCheck http://www.shellcheck.net/
# $() are not fully portable (POSIX != portable).
#   shellcheck disable=SC2006
# Disable source following.
#   shellcheck disable=SC1090,SC1091
# Not wanting to escape single quotes.
#   shellcheck disable=SC1003

# These variables will be overridden by the test helpers.
stdoutF="${TMPDIR:-/tmp}/STDOUT"
stderrF="${TMPDIR:-/tmp}/STDERR"

# Load test helpers.
. ./shunit2_test_helpers

testSkipping() {
  # We shouldn't be skipping to start.
  if isSkipping; then
    th_error 'skipping *should not be* enabled'
    return
  fi

  startSkipping
  was_skipping_started=${SHUNIT_FALSE}
  if isSkipping; then was_skipping_started=${SHUNIT_TRUE}; fi

  endSkipping
  was_skipping_ended=${SHUNIT_FALSE}
  if isSkipping; then was_skipping_ended=${SHUNIT_TRUE}; fi

  assertEquals "skipping wasn't started" "${was_skipping_started}" "${SHUNIT_TRUE}"
  assertNotEquals "skipping wasn't ended" "${was_skipping_ended}" "${SHUNIT_TRUE}"
  return 0
}

testStartSkippingWithMessage() {
  unittestF="${SHUNIT_TMPDIR}/unittest"
  sed 's/^#//' >"${unittestF}" <<\EOF
## Start skipping with a message.
#testSkipping() {
#  startSkipping 'SKIP-a-Dee-Doo-Dah'
#}
#SHUNIT_COLOR='none'
#. ${TH_SHUNIT}
EOF
{'fraction_non_alphanumeric': 0.14112763749567625, 'fraction_numerical': 0.022137668626772744, 'mean_word_length': 4.818913480885312, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1323799', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1042, 'n_words': 250}