<commit_before>import { Whitespace } from '../whitespace/whitespace';

export class StringHelper {

    readonly whitespace = new Whitespace();

    /**
     * Assert supplied strings are equal. Shows line by line difference
     */
    assertEquals(one: string, other: string): void {
        const oneLines = this.lines(one);
        const otherLines = this.lines(other);
        expect(oneLines.length).toEqual(otherLines.length);

        for (let i = 0; i < oneLines.length; i++) {
            expect(this.whitespace.show(oneLines[i])).toEqual(this.whitespace.show(otherLines[i]));
        }
    }

    private lines(value: string): string[] {
        return value.split('\n');
    }

}<commit_msg>Add line numbers to string helper output<commit_after>import { Whitespace } from '../whitespace/whitespace';

export class StringHelper {

    readonly whitespace = new Whitespace();

    /**
     * Assert supplied strings are equal. Shows line by line difference
     */
    assertEquals(one: string, other: string): void {
        const oneLines = this.lines(one);
        const otherLines = this.lines(other);
        expect(oneLines.length).toEqual(otherLines.length);

        for (let i = 0; i < oneLines.length; i++) {
            expect('[line ' + i + ']' + this.whitespace.show(oneLines[i])).toEqual('[line ' + i + ']' + this.whitespace.show(otherLines[i]));
        }
    }

    private lines(value: string): string[] {
        return value.split('\n');
    }

}
{'fraction_non_alphanumeric': 0.14101694915254237, 'fraction_numerical': 0.0013559322033898306, 'mean_word_length': 2.7943444730077123, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1075017', 'n_tokens_mistral': 441, 'n_tokens_neox': 433, 'n_words': 104}