<commit_before>module Benchmark.MathTest exposing (..)

import Benchmark.Math exposing (..)
import Expect exposing (Expectation)
import Fuzz
import Test exposing (..)


reasonablyCloseTo : Float -> Maybe Float -> Expectation
reasonablyCloseTo target maybeActual =
    case maybeActual of
        Nothing ->
            Expect.fail <| "got a null result (Nothing) instead of " ++ toString target

        Just actual ->
            if target - 0.001 <= actual && actual <= target + 0.001 then
                Expect.pass
            else
                Expect.fail <| toString actual ++ " was not within 0.0001 of " ++ toString target


floatify : List ( Int, Int ) -> List ( Float, Float )
floatify =
    List.map (\( x, y ) -> ( toFloat x, toFloat y ))


meanTest : Test
meanTest =<commit_msg>remove floatify, I never needed it after all<commit_after>module Benchmark.MathTest exposing (..)

import Benchmark.Math exposing (..)
import Expect exposing (Expectation)
import Fuzz
import Test exposing (..)


reasonablyCloseTo : Float -> Maybe Float -> Expectation
reasonablyCloseTo target maybeActual =
    case maybeActual of
        Nothing ->
            Expect.fail <| "got a null result (Nothing) instead of " ++ toString target

        Just actual ->
            if target - 0.001 <= actual && actual <= target + 0.001 then
                Expect.pass
            else
                Expect.fail <| toString actual ++ " was not within 0.0001 of " ++ toString target


meanTest : Test
meanTest =
{'fraction_non_alphanumeric': 0.0966022651565623, 'fraction_numerical': 0.017321785476349102, 'mean_word_length': 2.4058956916099774, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '4796516', 'n_tokens_mistral': 432, 'n_tokens_neox': 390, 'n_words': 146}