<commit_before>extern crate tinyexpr;

#[test]
fn check_basics() {
    assert_eq!(tinyexpr::interp("2*2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("2+2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("5%2").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("2+2*2").unwrap(), 6.0);
    assert_eq!(tinyexpr::interp("(2+2)*2").unwrap(), 8.0);
    assert_eq!(tinyexpr::interp("(2+2)*2/2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("abs(-1)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("sqrt(728*728)").unwrap(), 728.0);
    assert_eq!(tinyexpr::interp("pow(2.0, 3.0)").unwrap(), 8.0);
    assert_eq!(tinyexpr::interp("exp(1)").unwrap(), tinyexpr::interp("e").unwrap());
    assert_eq!(tinyexpr::interp("floor(3.1415)").unwrap(), 3.0);
    assert_eq!(tinyexpr::interp("ceil(3.1415)*floor(3.1415)").unwrap(), 12.0);
}

#[test]
fn check_constants() {
    assert_eq!(tinyexpr::interp("pi").unwrap(), 3.141592653589793);
    assert_eq!(tinyexpr::interp("e").unwrap(), 2.718281828459045);
}

#[test]
fn check_logarithms() {
    assert_eq!(tinyexpr::interp("ln(e)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("log(10)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("log10(10)").unwrap(), 1.0);<commit_msg>added sub to tests<commit_after>extern crate tinyexpr;

#[test]
fn check_basics() {
    assert_eq!(tinyexpr::interp("2*2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("2+2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("3-2").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("5%2").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("2+2*2").unwrap(), 6.0);
    assert_eq!(tinyexpr::interp("(2+2)*2").unwrap(), 8.0);
    assert_eq!(tinyexpr::interp("(2+2)*2/2").unwrap(), 4.0);
    assert_eq!(tinyexpr::interp("abs(-1)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("sqrt(728*728)").unwrap(), 728.0);
    assert_eq!(tinyexpr::interp("pow(2.0, 3.0)").unwrap(), 8.0);
    assert_eq!(tinyexpr::interp("exp(1)").unwrap(), tinyexpr::interp("e").unwrap());
    assert_eq!(tinyexpr::interp("floor(3.1415)").unwrap(), 3.0);
    assert_eq!(tinyexpr::interp("ceil(3.1415)*floor(3.1415)").unwrap(), 12.0);
}

#[test]
fn check_constants() {
    assert_eq!(tinyexpr::interp("pi").unwrap(), 3.141592653589793);
    assert_eq!(tinyexpr::interp("e").unwrap(), 2.718281828459045);
}

#[test]
fn check_logarithms() {
    assert_eq!(tinyexpr::interp("ln(e)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("log(10)").unwrap(), 1.0);
    assert_eq!(tinyexpr::interp("log10(10)").unwrap(), 1.0);
{'fraction_non_alphanumeric': 0.2701838529176659, 'fraction_numerical': 0.09112709832134293, 'mean_word_length': 6.383480825958702, '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': '7077267', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1042, 'n_words': 98}