<commit_before>#!/bin/sh

set -o nounset

#
#----Constants
#
readonly GENERIC_EXIT_VAL="33"
readonly INVALID_OPTION_ERROR="1"
readonly GREEN='\033[0;32m'
readonly NO_COLOR='\033[0m'
readonly NOW="$(date +'%Y-%m-%d-%H.%M.%S')"
readonly PROGRAM_PATH="./realpath"
readonly PWD="$(ruby -e "puts File.realpath('$(pwd)')")"
readonly REAL_PATH_ERROR="2"
readonly RED='\033[0;31m'
readonly TEST_DIR="test_files_$NOW"


#
#----Functions
#

function assert_numbers_eq() {
	local readonly EXPECTED="$1"
	local readonly ACTUAL="$2"
	local readonly MSG="$3"
	local readonly EXIT_VAL="$4"

	if [ "$EXPECTED" -ne "$ACTUAL" ]; then
		echo " EXPECTED='$EXPECTED'  ACTUAL='$ACTUAL' $MSG"
		fail "$EXIT_VAL"
	fi
}

function fail() {
	echo " ${RED}FAILED${NO_COLOR}"
	if [ "x${1}" == "x" ]; then
	echo "here"
		exit "$GENERIC_EXIT_VAL"
	fi

	exit "$1"
}

function ok() {
	echo " ${GREEN}OK${NO_COLOR}"
}

function random_string() {
	if [ -c "/dev/urandom" ]; then
		grep -m 5 -ao '[a-zA-Z0-9]' /dev/urandom | tr '\n' '_' | sed s/_//g
	else
		date +"%s"
	fi
}

function test_no_option() {
	echo ""
	echo "Running test_no_option"

	local readonly RESULT=`./realpath`
	local readonly local EXIT_VAL="$?"

	if [ "$PWD" == "$RESULT" ];then
		ok
	else
		fail 100;
	fi<commit_msg>Adding NAME_MAX to test<commit_after>#!/bin/sh

set -o nounset

#
#----Constants
#
readonly GENERIC_EXIT_VAL='33'
readonly INVALID_OPTION_ERROR='1'
readonly GREEN='\033[0;32m'
readonly NAME_MAX='255'
readonly NO_COLOR='\033[0m'
readonly NOW="$(date +'%Y-%m-%d-%H.%M.%S')"
readonly PROGRAM_PATH='./realpath'
readonly PWD="$(ruby -e "puts File.realpath('$(pwd)')")"
readonly REAL_PATH_ERROR='2'
readonly RED='\033[0;31m'
readonly TEST_DIR="test_files_$NOW"


#
#----Functions
#

function assert_numbers_eq() {
	local readonly EXPECTED="$1"
	local readonly ACTUAL="$2"
	local readonly MSG="$3"
	local readonly EXIT_VAL="$4"

	if [ "$EXPECTED" -ne "$ACTUAL" ]; then
		echo " EXPECTED='$EXPECTED'  ACTUAL='$ACTUAL' $MSG"
		fail "$EXIT_VAL"
	fi
}

function fail() {
	echo " ${RED}FAILED${NO_COLOR}"
	if [ "x${1}" == "x" ]; then
	echo "here"
		exit "$GENERIC_EXIT_VAL"
	fi

	exit "$1"
}

function ok() {
	echo " ${GREEN}OK${NO_COLOR}"
}

function random_string() {
	if [ -c "/dev/urandom" ]; then
		grep -m 5 -ao '[a-zA-Z0-9]' /dev/urandom | tr '\n' '_' | sed s/_//g | colrm "$NAME_MAX"
	else
		date +"%s"
	fi
}

function test_no_option() {
	echo ""
	echo "Running test_no_option"

	local readonly RESULT=`./realpath`
	local readonly local EXIT_VAL="$?"

	if [ "$PWD" == "$RESULT" ];then
		ok
	else
		fail 100;
	fi
{'fraction_non_alphanumeric': 0.196484375, 'fraction_numerical': 0.026171875, 'mean_word_length': 4.346555323590814, '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': '4271153', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1051, 'n_words': 240}