<commit_before>extern crate clang_sys;
extern crate libc;

use std::ptr;

use clang_sys::*;

use libc::{c_char};

fn parse() {
    unsafe {
        let index = clang_createIndex(0, 0);
        assert!(!index.is_null());

        let tu = clang_parseTranslationUnit(
            index,
            "tests/header.h\0".as_ptr() as *const c_char,
            ptr::null_mut(),
            0,
            ptr::null_mut(),
            0,
            CXTranslationUnit_Flags::empty(),
        );
        assert!(!tu.is_null());
    }
}

#[cfg(feature="runtime")]
#[test]
fn test() {
    load().unwrap();
    parse();
    unload().unwrap();
}

#[cfg(not(feature="runtime"))]
#[test]
fn test() {
    parse();
}

#[test]
fn test_support() {
    let clang = support::Clang::find(None).unwrap();
    println!("{:?}", clang);
}<commit_msg>Fix tests<commit_after>extern crate clang_sys;
extern crate libc;

use std::ptr;

use clang_sys::*;

use libc::{c_char};

fn parse() {
    unsafe {
        let index = clang_createIndex(0, 0);
        assert!(!index.is_null());

        let tu = clang_parseTranslationUnit(
            index,
            "tests/header.h\0".as_ptr() as *const c_char,
            ptr::null_mut(),
            0,
            ptr::null_mut(),
            0,
            CXTranslationUnit_Flags::empty(),
        );
        assert!(!tu.is_null());
    }
}

#[cfg(feature="runtime")]
#[test]
fn test() {
    load().unwrap();
    parse();
    unload().unwrap();
}

#[cfg(not(feature="runtime"))]
#[test]
fn test() {
    parse();
}

#[test]
fn test_support() {
    let clang = support::Clang::find(None, &[]).unwrap();
    println!("{:?}", clang);
}
{'fraction_non_alphanumeric': 0.1901877649909146, 'fraction_numerical': 0.0060569351907934586, 'mean_word_length': 2.420289855072464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3982612', 'n_tokens_mistral': 577, 'n_tokens_neox': 579, 'n_words': 110}