<commit_before>source array.sh

array list

if declare list &> /dev/null; then
  echo "array init: ok"
else
  echo "array init: fail"
fi

list[+] "first"
list[+] "second"
list[+] "third"
list[+] "end of array"

if test "$(list[*])" == "first second third end of array"; then
  echo "array itens: ok"
else
  echo "array itens: fail"
fi

if list[?] 4; then
  echo "array check size: ok"
else
  echo "array check size: fail"
fi

list[-] 0

if list[?] 3; then
  echo "array removed: ok"
else
  echo "array removed: fail"
fi

list[~]; do
  if test "${list[i]}" == "$(list[i])"; then
    echo "array loop: '${list[i]}' ok"
  else
    echo "array loop: '${list[i]}' fail"
  fi
done

if test "$(list[:] 0 2)" == "second third"; then
  echo "array subarray: ok ($(list[:] 0 2))"
else
  echo "array subarray: fail"
fi<commit_msg>The tests of the array were rewritten<commit_after>source array.sh
source asserts.sh

array list

assert_variable list
assert_function list[*]
assert_function list[@] # function to show all itens
assert_function list[#] # function to handle array size
assert_function list[!] # function to show array index
assert_function list[+] # function to add
assert_function list[-] # function to remove
assert_function list[:] # function to split a subarray

list[+] "first"
list[+] "second"
list[+] "third"
list[+] "end of array"

assert_equal "$(list[*])" "first second third end of array"

assert list[#] -eq 4

list[-] 0

assert list[#] -eq 3

list[~]; do
  assert_equal "${list[i]}" "$(list[i])"
done

assert_equal "$(list[:] 0 2)" "second third"

{'fraction_non_alphanumeric': 0.15749039692701663, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 4.389655172413793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2313207', 'n_tokens_mistral': 580, 'n_tokens_neox': 555, 'n_words': 215}