<commit_before>class TestList<Element>(Element... elems) satisfies List<Element> {
    shared actual Boolean equals(Object other) { return List::equals(other); }
    shared actual Element? item(Integer x) { return elems[x]; }
    shared actual TestList<Element> reversed { return TestList(elems.reversed...); }
    shared actual Integer hash { return List::hash; }
    shared actual Integer? lastIndex { return elems.lastIndex; }
    shared actual TestList<Element> span(Integer a, Integer b) { return TestList(elems.span(a, b)...); }
    shared actual TestList<Element> spanFrom(Integer a) { return TestList(elems.spanFrom(a)...); }
    shared actual TestList<Element> spanTo(Integer b) { return TestList(elems.spanTo(b)...); }
    shared actual TestList<Element> segment(Integer a, Integer b) { return TestList(elems.segment(a, b)...); }
    shared actual TestList<Element> clone { return TestList(elems...); }
}

void lists() {
    value a = TestList(1,2,3,4);
    value b = LazyList({1,2,3,4,5,6,7,8});
    check(LazyList({}).size==0, "empty LazyList()");
    //withLeading
    check({}.withLeading("A")=={"A"}, "Empty.withLeading(A)");
    check({}.withLeading("foo").size==1, "{}.withLeading.size");
    check(array().withLeading(1)=={1}, "empty array.withLeading(1)");
    check(array(1,2).withLeading("A")=={"A",1,2}, "Array.withLeading(a)");
    check({1,2}.withLeading("a")=={"a",1,2}, "Sequence.withLeading(a)");
    check({1,2}.withLeading("foo").size==3, "Sequence.withLeading.size");
    check(Singleton(1).withLeading("a")=={"a",1}, "Singleton.withLeading(a)");
    check((1..3).withLeading("a")=={"a",1,2,3}, "Range.withLeading(a)");
    check((1..3).withLeading(0).first==0, "Range.withLeading(a).first");
    check((1..3).withLeading(0).last==3, "Range.withLeading(a).last");
    check("abc".withLeading(1)=={1,`a`,`b`,`c`}, "String.withLeading(1)");<commit_msg>Add more info to assertion failure messages<commit_after>class TestList<Element>(Element... elems) satisfies List<Element> {
    shared actual Boolean equals(Object other) { return List::equals(other); }
    shared actual Element? item(Integer x) { return elems[x]; }
    shared actual TestList<Element> reversed { return TestList(elems.reversed...); }
    shared actual Integer hash { return List::hash; }
    shared actual Integer? lastIndex { return elems.lastIndex; }
    shared actual TestList<Element> span(Integer a, Integer b) { return TestList(elems.span(a, b)...); }
    shared actual TestList<Element> spanFrom(Integer a) { return TestList(elems.spanFrom(a)...); }
    shared actual TestList<Element> spanTo(Integer b) { return TestList(elems.spanTo(b)...); }
    shared actual TestList<Element> segment(Integer a, Integer b) { return TestList(elems.segment(a, b)...); }
    shared actual TestList<Element> clone { return TestList(elems...); }
}

void lists() {
    value a = TestList(1,2,3,4);
    value b = LazyList({1,2,3,4,5,6,7,8});
    check(LazyList({}).size==0, "empty LazyList()");
    //withLeading
    check({}.withLeading("A")=={"A"}, "Empty.withLeading(A)");
    check({}.withLeading("foo").size==1, "{}.withLeading.size");
    check(array().withLeading(1)=={1}, "empty array.withLeading(1)");
    check(array(1,2).withLeading("A")=={"A",1,2}, "Array.withLeading(a)" array(1,2).withLeading("A") "");
    check({1,2}.withLeading("a")=={"a",1,2}, "Sequence.withLeading(a)" {1,2}.withLeading("a") "");
    check({1,2}.withLeading("foo").size==3, "Sequence.withLeading.size" {1,2}.withLeading("foo").size "");
    check(Singleton(1).withLeading("a")=={"a",1}, "Singleton.withLeading(a)" Singleton(1).withLeading("a") "");
    check((1..3).withLeading("a")=={"a",1,2,3}, "Range.withLeading(a)");
    check((1..3).withLeading(0).first==0, "Range.withLeading(a).first");
    check((1..3).withLeading(0).last==3, "Range.withLeading(a).last");
    check("abc".withLeading(1)=={1,`a`,`b`,`c`}, "String.withLeading(1)" +"abc".withLeading(1).string);
{'fraction_non_alphanumeric': 0.22095383054287163, 'fraction_numerical': 0.025367833587011668, 'mean_word_length': 5.268680445151033, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5586016', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1394, 'n_words': 234}