<commit_before>open OUnit

let equ = assert_equal

let test_version_getting _ =
        let version = Archive.version_string () in
        let name = String.sub version 0 10 in
        equ name "libarchive"

let suite = "Simple tests" >::: [
        "test_version_getting" >:: test_version_getting
        ]

let _ =
        run_test_tt_main suite<commit_msg>Added another simple unit test, one that decompresses<commit_after>open OUnit

let equ = assert_equal

let test_version_getting _ =
        let version = Archive.version_string () in
        let name = String.sub version 0 10 in
        equ name "libarchive"

let raw_gz_file =
  "\x1f\x8b\x08\x00\xcd\x65\x42\x51\x00\x03\x0b\xc9\xc8\x2c\x56\x00\xa2\x44\
  \x85\x92\xd4\xe2\x12\x85\xb4\xcc\x9c\x54\x2e\x8f\xd4\x9c\x9c\x7c\x2e\x00\
  \xd2\xc2\x5e\x1b\x1a\x00\x00\x00"
let raw_file = "This is a test file\nHello\n"

let test_decompress_raw_single_file _ =
    let handle = Archive.read_new_configured
        [Archive.RawFormatReader]
        [Archive.AllFilterReader] in
    ignore (Archive.read_open_memory handle raw_gz_file (String.length raw_gz_file));
    let archive_contents = Archive.extract_all handle in
    let first = List.hd archive_contents in
    match first with
        | Archive.File (content, meta) -> equ content raw_file
        | _ -> assert_failure "Did not get a single file"


let suite = "Simple tests" >::: [
        "test_version_getting" >:: test_version_getting;
        "test_decompress_raw_single_file" >:: test_decompress_raw_single_file
        ]

let _ =
        run_test_tt_main suite
{'fraction_non_alphanumeric': 0.0944233206590621, 'fraction_numerical': 0.042458808618504436, 'mean_word_length': 3.0076142131979697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '3582564', 'n_tokens_mistral': 614, 'n_tokens_neox': 567, 'n_words': 120}