<commit_before>use cripes::util::iter::*;

/// Test the `Once` iterator.
#[test]
fn test_once() {
    let mut n = 0;

    let y = "foo";
    for something in Once::new(y) { n += 1; println!("{:?}", something); }
    assert_eq!(1, n);

    let things = vec!['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
    n = 0;
    for something in Once::new(&things) { n += 1; println!("{:?}", something); }
    assert_eq!(1, n);

    n = 0;
    for something in things.iter() {
        for _ in Once::new(something) { n += 1 }
    }
    assert_eq!(n, 26);<commit_msg>test_iter.rs: add an extra simple test for Once<commit_after>use cripes::util::iter::*;

/// Test the `Once` iterator.
#[test]
fn test_once() {
    assert_eq!(1, Once::new(42).count());

    let mut n = 0;
    let y = "foo";
    for something in Once::new(y) { n += 1; println!("{:?}", something); }
    assert_eq!(1, n);

    let things = vec!['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
    n = 0;
    for something in Once::new(&things) { n += 1; println!("{:?}", something); }
    assert_eq!(1, n);

    n = 0;
    for something in things.iter() {
        for _ in Once::new(something) { n += 1 }
    }
    assert_eq!(n, 26);
{'fraction_non_alphanumeric': 0.28171091445427726, 'fraction_numerical': 0.01696165191740413, 'mean_word_length': 2.9911764705882353, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2460372', 'n_tokens_mistral': 578, 'n_tokens_neox': 560, 'n_words': 166}