<commit_before>#!perl6

use v6;
use lib 'lib';
use Test;

use Audio::Sndfile;

done;
# vim: expandtab shiftwidth=4 ft=perl6<commit_msg>New read tests<commit_after>#!perl6

use v6;
use lib 'lib';
use Test;

use Audio::Sndfile;

my @tests = (
                {:channels(1), :filename("t/data/1sec-chirp-44100.caf"), :format(1572870), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.w64"), :format(720902), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.w64"), :format(720902), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.aifc"), :format(131078), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.aif"), :format(131078), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.au"), :format(196614), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.wav"), :format(65542), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.w64"), :format(720902), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.aiff"), :format(131078), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.wav"), :format(65542), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.aifc"), :format(131078), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.aiff"), :format(131078), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.aif"), :format(131078), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.au"), :format(196614), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.aif"), :format(131078), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.au"), :format(196614), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.wav"), :format(65542), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.caf"), :format(1572870), :frames(22050), :sample-rate(22050), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-44100.aiff"), :format(131078), :frames(44100), :sample-rate(44100), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-48000.caf"), :format(1572870), :frames(48000), :sample-rate(48000), :sections(1), :seekable}, 
                {:channels(1), :filename("t/data/1sec-chirp-22050.aifc"), :format(131078), :frames(22050), :sample-rate(22050), :sections(1), :seekable}
        );

for @tests -> $test {
    my Audio::Sndfile $obj;
    lives-ok { $obj = Audio::Sndfile.new(filename => $test<filename>, :r) }, "get " ~ $test<filename>;
    is($obj.info.format, $test<format>, "got the right format");

    lives-ok { $obj.close }, "close that";
}

done;
# vim: expandtab shiftwidth=4 ft=perl6
{'fraction_non_alphanumeric': 0.2246510402949697, 'fraction_numerical': 0.13642349223070846, 'mean_word_length': 4.125506072874494, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '6458039', 'n_tokens_mistral': 1739, 'n_tokens_neox': 1430, 'n_words': 203}