<commit_before>﻿module testUtils
open System
open NUnit.Framework
open Amyris.Bio.utils

[<Test>]
let testPaddedZip() =
    let smaller = [1;2;];
    let larger = [1;2;3;4;];

    let correctZip =
        [Some(1), Some(1); Some(2), Some(2); None, Some(3); None, Some(4)]

    let check x y correct =
        Assert.AreEqual( (zipWithPad x y) |> List.ofSeq, correct)

    check smaller larger correctZip

    check [] [] []
    check [1] [] [Some(1), None]
    check [] [1] [None, Some(1)]<commit_msg>TST: add tests for expected behavior of format60<commit_after>﻿module testUtils
open System
open NUnit.Framework
open Amyris.Bio.utils

[<Test>]
let testPaddedZip() =
    let smaller = [1;2;];
    let larger = [1;2;3;4;];

    let correctZip =
        [Some(1), Some(1); Some(2), Some(2); None, Some(3); None, Some(4)]

    let check x y correct =
        Assert.AreEqual( (zipWithPad x y) |> List.ofSeq, correct)

    check smaller larger correctZip

    check [] [] []
    check [1] [] [Some(1), None]
    check [] [1] [None, Some(1)]

[<Test>]
let testFormat60() =
    Assert.AreEqual("", format60 [||])
    Assert.AreEqual("A", format60 [|'A'|])
    Assert.AreEqual("AT", format60 [|'A'; 'T'|])


    let A60 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
    let A60Arr = [|for c in A60 -> c|]

    let A61Arr = Array.append A60Arr [|'A'|]
    let A61Result = A60 + "\nA"

    Assert.AreEqual(A60, format60 A60Arr)
    Assert.AreEqual(A61Result, format60 A61Arr)
{'fraction_non_alphanumeric': 0.1641991924629879, 'fraction_numerical': 0.04576043068640646, 'mean_word_length': 3.373529411764706, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1865230', 'n_tokens_mistral': 571, 'n_tokens_neox': 529, 'n_words': 145}