<commit_before>void iterate<Element>(List<Element> list) 
    given Element satisfies Object {
    for (element in list) {
        check(element in list);
    }
}

void compareIterables<T>(Iterable<T> aIterable, Iterable<T> bIterable, String message)
    given T satisfies Object {
    
    Iterator<T> bIterator = bIterable.iterator();
    for(T a in aIterable){
        T|Finished b0 = bIterator.next();
        check(b0 != finished, "``message``: Iterator B empty while expecting '``a``'");
        check(a == b0, "``message``: Element '``a``' != '``b0``'");
    }
    T|Finished b = bIterator.next();
    check(b == finished, "``message``: Iterator B not empty: extra '``b``'");
}

@test
shared void strings() {
    value hello = "hello";
    
    check(hello.includes("lo"), "string includes string");
    check(hello.includes(['l','o']), "string includes list");
    check(hello.includesAt(3,"lo"), "string includesAt string 1");
    check(hello.includesAt(3,['l','o']), "string includesAt list 1");
    check(!hello.includesAt(2,"lo"), "string not includesAt string");
    check(!hello.includesAt(2,['l','o']), "string not includesAt list");
    check(hello.includesAt(0,"hell"), "string includesAt string 2");
    check(hello.includesAt(0,['h','e','l','l']), "string includesAt list 2");
    
    check(hello.occurs('l'), "string occurs");
    check(!hello.occurs('x'), "not string occurs 1");
    check(hello.occursAt(3,'l'), "string occursAt 1");
    check(hello.occursAt(2,'l'), "string occursAt 2");
    check(!hello.occursAt(2,'x'), "string occursAt 3");
    
    check(hello.occurrences('l').sequence()==[2,3], "string occurrences");
    check(hello.inclusions("l").sequence()==[2,3], "string inclusions");
    check(hello.inclusions("hell").sequence()==[0], "string inclusions");
    check("aabbaa".inclusions("aa").sequence()==[0,4], "string inclusions");
    
    check(hello.size==5, "string size 1");
    check("".size==0, "empty string size 2");
    check(!"".sequence() nonempty);
    check("a".sequence() nonempty);
    check(!"".lastIndex exists, "empty string last index");
    check(!""[0] exists, "empty string first element exists");
    check(!(hello of Object) is Identifiable, "string is Identifiable");
    
    check("abcd".size==4, "string size 3");
    
    check("http://foo.com".spanFrom(4)=="://foo.com", "string spanFrom 0");
    check("http://foo.com".spanTo(3)=="http", "string spanTo 0");
    check(hello.span(-2,-1)=="", "string span -2");
    check(hello.span(-2,0)=="h", "string span -1");
    check(hello.span(1,3)=="ell", "string span 1");
    check(hello.spanFrom(1)=="ello", "string spanFrom 2");
    check(hello.spanFrom(10)=="", "string spanFrom 3");
    check(hello.spanTo(1)=="he", "string spanTo 2");
    check(hello.spanTo(-1)=="", "string spanTo 3");
    check(hello.span(1,hello.size)=="ello", "string span 3");
    check(hello.span(1,10)=="ello", "string span 4");
    check(hello.span(2,1)=="le", "string span 5");
    check(hello.span(20,10)=="", "string span 6");
    
    check(hello.measure(1,3)=="ell", "string measure 1");
    check(hello.measure(1,5)=="ello", "string measure 2");
    check(hello.measure(1,0)=="", "string measure 3");
    check(hello.measure(1,10)=="ello", "string measure 4");
    check(hello.measure(10,20)=="", "string measure 5 expected empty string got ``hello.measure(10,20)``");
    <commit_msg>disable a strings test<commit_after>void iterate<Element>(List<Element> list) 
    given Element satisfies Object {
    for (element in list) {
        check(element in list);
    }
}

void compareIterables<T>(Iterable<T> aIterable, Iterable<T> bIterable, String message)
    given T satisfies Object {
    
    Iterator<T> bIterator = bIterable.iterator();
    for(T a in aIterable){
        T|Finished b0 = bIterator.next();
        check(b0 != finished, "``message``: Iterator B empty while expecting '``a``'");
        check(a == b0, "``message``: Element '``a``' != '``b0``'");
    }
    T|Finished b = bIterator.next();
    check(b == finished, "``message``: Iterator B not empty: extra '``b``'");
}

@test
shared void strings() {
    value hello = "hello";
    
    check(hello.includes("lo"), "string includes string");
    check(hello.includes(['l','o']), "string includes list");
    check(hello.includesAt(3,"lo"), "string includesAt string 1");
    check(hello.includesAt(3,['l','o']), "string includesAt list 1");
    check(!hello.includesAt(2,"lo"), "string not includesAt string");
    check(!hello.includesAt(2,['l','o']), "string not includesAt list");
    check(hello.includesAt(0,"hell"), "string includesAt string 2");
    check(hello.includesAt(0,['h','e','l','l']), "string includesAt list 2");
    
    check(hello.occurs('l'), "string occurs");
    check(!hello.occurs('x'), "not string occurs 1");
    check(hello.occursAt(3,'l'), "string occursAt 1");
    check(hello.occursAt(2,'l'), "string occursAt 2");
    check(!hello.occursAt(2,'x'), "string occursAt 3");
    
    check(hello.occurrences('l').sequence()==[2,3], "string occurrences");
    check(hello.inclusions("l").sequence()==[2,3], "string inclusions");
    check(hello.inclusions("hell").sequence()==[0], "string inclusions");
    check("aabbaa".inclusions("aa").sequence()==[0,4], "string inclusions");
    
    check(hello.size==5, "string size 1");
    check("".size==0, "empty string size 2");
    check(!"".sequence() nonempty);
    check("a".sequence() nonempty);
    check(!"".lastIndex exists, "empty string last index");
    check(!""[0] exists, "empty string first element exists");
// FIXME Dart disabling; known limitation for now
    //check(!(hello of Object) is Identifiable, "string is Identifiable");
    
    check("abcd".size==4, "string size 3");
    
    check("http://foo.com".spanFrom(4)=="://foo.com", "string spanFrom 0");
    check("http://foo.com".spanTo(3)=="http", "string spanTo 0");
    check(hello.span(-2,-1)=="", "string span -2");
    check(hello.span(-2,0)=="h", "string span -1");
    check(hello.span(1,3)=="ell", "string span 1");
    check(hello.spanFrom(1)=="ello", "string spanFrom 2");
    check(hello.spanFrom(10)=="", "string spanFrom 3");
    check(hello.spanTo(1)=="he", "string spanTo 2");
    check(hello.spanTo(-1)=="", "string spanTo 3");
    check(hello.span(1,hello.size)=="ello", "string span 3");
    check(hello.span(1,10)=="ello", "string span 4");
    check(hello.span(2,1)=="le", "string span 5");
    check(hello.span(20,10)=="", "string span 6");
    
    check(hello.measure(1,3)=="ell", "string measure 1");
    check(hello.measure(1,5)=="ello", "string measure 2");
    check(hello.measure(1,0)=="", "string measure 3");
    check(hello.measure(1,10)=="ello", "string measure 4");
    check(hello.measure(10,20)=="", "string measure 5 expected empty string got ``hello.measure(10,20)``");
    
{'fraction_non_alphanumeric': 0.21768408724930463, 'fraction_numerical': 0.027228809837505488, 'mean_word_length': 4.38801261829653, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 15, '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': '3303461', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2281, 'n_words': 518}