<commit_before>require_relative 'ruby_interop.rb'
require_relative 'core.rb'
require_relative 'numbers.rb'
require_relative 'list.rb'

FAIL = ->_{Raise["\e[31mFailed\e[0m"]}
PASS = Print["\e[32mT\e[0m"]
Assert=->bool{If[PASS][FAIL][bool]}
Refute=->bool{If[FAIL][PASS][bool]}


MakeAssert1=->operator{
->first{
  Assert[operator[first]]
}}
MakeAssert2=->operator{
->first{->second{
  Assert[operator[first][second]]
}}}

MakeRefute1=->operator{
->first{
  Refute[operator[first]]
}}
MakeRefute2=->operator{
->first{->second{
  Refute[operator[first][second]]
}}}

AssertZero=MakeAssert1[IsZero]
AssertNumbersEqual=MakeAssert2[NumbersEqual]
RefuteNumbersEqual=MakeRefute2[NumbersEqual]

AssertEmpty=MakeAssert1[IsEmpty]
RefuteEmpty=MakeRefute1[IsEmpty]
AssertListsEqual=->element_equality_operator{MakeAssert2[ListsEqual[element_equality_operator]]}<commit_msg>Numeric assertion/refutation shows the difference between expected and actual<commit_after>require_relative 'ruby_interop.rb'
require_relative 'core.rb'
require_relative 'numbers.rb'
require_relative 'list.rb'

FAIL = ->_{Raise["\e[31mFailed\e[0m"]}
PASS = Print["\e[32mT\e[0m"]
Assert=->bool{If[PASS][FAIL][bool]}
Refute=->bool{If[FAIL][PASS][bool]}


MakeAssert1=->operator{
->first{
  Assert[operator[first]]
}}
MakeAssert2=->operator{
->first{->second{
  Assert[operator[first][second]]
}}}

MakeRefute1=->operator{
->first{
  Refute[operator[first]]
}}
MakeRefute2=->operator{
->first{->second{
  Refute[operator[first][second]]
}}}

AssertZero=MakeAssert1[IsZero]
AssertNumbersEqual=
->expected{->actual{
  If[
    PASS
  ][
    ->_{ Raise["\e[31mFailed: Expected #{ConvertToRubyNumber[expected]}, got #{ConvertToRubyNumber[actual]}.\e[39m"] }
  ][
    NumbersEqual[expected][actual]
  ]
}}
RefuteNumbersEqual=
->expected{->actual{
  If[
    ->_{ Raise["\e[31mFailed: Expected #{ConvertToRubyNumber[actual]} to *NOT EQUAL* #{ConvertToRubyNumber[expected]}.\e[39m"] }
  ][
    PASS
  ][
    NumbersEqual[expected][actual]
  ]
}}

AssertEmpty=MakeAssert1[IsEmpty]
RefuteEmpty=MakeRefute1[IsEmpty]
AssertListsEqual=->element_equality_operator{MakeAssert2[ListsEqual[element_equality_operator]]}
{'fraction_non_alphanumeric': 0.17532467532467533, 'fraction_numerical': 0.017625231910946195, 'mean_word_length': 7.9875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, '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': '3539846', 'n_tokens_mistral': 811, 'n_tokens_neox': 768, 'n_words': 91}