<commit_before>! Copyright (C) 2018 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: byte-arrays checksums checksums.md5 checksums.multi
checksums.sha io io.encodings.binary io.files namespaces tools.test ;
IN: checksums.multi.tests

{
    {
        B{ 9 143 107 205 70 33 211 115 202 222 78 131 38 39 180 246 }
        B{
            169 74 143 229 204 177 155 166 28 76 8 115 211 145 233
            135 152 47 187 211
        }
    }
} [
    "test" >byte-array { md5 sha1 } <multi-checksum> checksum-bytes
] unit-test

{
    {
        B{ 220 158 207 218 50 163 198 36 234 90 122 65 197 14 224 16 }
        B{
            132 132 148 224 101 202 198 114 38 53 127 18 70 170 108
            53 25 255 174 207
        }
    }
} [
    "LICENSE.txt" binary [
        input-stream get { md5 sha1 } <multi-checksum> checksum-stream
    ] with-file-reader
] unit-test
<commit_msg>checksums.multi: use resource: to make sure test works.<commit_after>! Copyright (C) 2018 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: byte-arrays checksums checksums.md5 checksums.multi
checksums.sha io io.encodings.binary io.files namespaces tools.test ;
IN: checksums.multi.tests

{
    {
        B{ 9 143 107 205 70 33 211 115 202 222 78 131 38 39 180 246 }
        B{
            169 74 143 229 204 177 155 166 28 76 8 115 211 145 233
            135 152 47 187 211
        }
    }
} [
    "test" >byte-array { md5 sha1 } <multi-checksum> checksum-bytes
] unit-test

{
    {
        B{ 220 158 207 218 50 163 198 36 234 90 122 65 197 14 224 16 }
        B{
            132 132 148 224 101 202 198 114 38 53 127 18 70 170 108
            53 25 255 174 207
        }
    }
} [
    "resource:LICENSE.txt" binary [
        input-stream get { md5 sha1 } <multi-checksum> checksum-stream
    ] with-file-reader
] unit-test

{'fraction_non_alphanumeric': 0.08500270709258256, 'fraction_numerical': 0.2165674066053059, 'mean_word_length': 2.009771986970684, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6633226', 'n_tokens_mistral': 982, 'n_tokens_neox': 586, 'n_words': 239}