<commit_before>
import XCTest
@testable import Diff

class NestedExtendedDiffTests: XCTestCase {

    func testDiffOutputs() {
        let expectations = [
            (
                [
                    KeyedIntArray(elements: [], key: 1),
                    KeyedIntArray(elements: [], key: 0),
                ],
                [
                    KeyedIntArray(elements: [], key: 0),
                    KeyedIntArray(elements: [], key: 1),
                ],
                "MS(0,1)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [1, 2], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1, 2], key: 1),
                ],
                "MS(0,1)IE(1,1)"
            ),
            (
                [
                    KeyedIntArray(elements: [1, 2], key: 1),
                    KeyedIntArray(elements: [1, 2], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "MS(0,1)DE(1,0)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "MS(0,1)ME((0,1),(1,0))"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                [
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                "DS(0)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                ],
                [
                    KeyedIntArray(elements: [1], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "IS(0)"
            ),
            (
                [
                    KeyedIntArray(
                        elements: [
                            0,
                            1,
                            ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            2,
                            3,
                            ],
                        key: 1
                    ),
                ],
                [
                    KeyedIntArray(
                        elements: [
                            3,
                            2,
                            ],
                        key: 1
                    ),
                    KeyedIntArray(
                        elements: [
                            0,
                            1
                        ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            12
                        ],
                        key: 2
                    ),
                ],
                "MS(0,1)IS(2)ME((0,1),(1,0))"
            ),
            (
                [
                    KeyedIntArray(
                        elements: [
                            3,
                            2,
                            ],
                        key: 1
                    ),
                    KeyedIntArray(
                        elements: [
                            0,
                            1
                        ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            12
                        ],
                        key: 2
                    ),
                    ],
                [
                    KeyedIntArray(
                        elements: [
                            0,
                            1,
                            ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            2,
                            3,
                            ],
                        key: 1
                    ),
                    ],
                "MS(0,1)DS(2)ME((0,0),(1,1))"<commit_msg>Update test cases to handle slight differences in printing<commit_after>
import XCTest
@testable import Diff

class NestedExtendedDiffTests: XCTestCase {

    func testDiffOutputs() {
        let expectations = [
            (
                [
                    KeyedIntArray(elements: [], key: 1),
                    KeyedIntArray(elements: [], key: 0),
                ],
                [
                    KeyedIntArray(elements: [], key: 0),
                    KeyedIntArray(elements: [], key: 1),
                ],
                "MS(0,1)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [1, 2], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1, 2], key: 1),
                ],
                "MS(0,1)IE(1,1)"
            ),
            (
                [
                    KeyedIntArray(elements: [1, 2], key: 1),
                    KeyedIntArray(elements: [1, 2], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "MS(0,1)DE(1,0)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                [
                    KeyedIntArray(elements: [1, 2], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "MS(0,1)ME((item: 0, section: 1),(item: 1, section: 0))"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                [
                    KeyedIntArray(elements: [2, 1], key: 0),
                ],
                "DS(0)"
            ),
            (
                [
                    KeyedIntArray(elements: [1], key: 1),
                ],
                [
                    KeyedIntArray(elements: [1], key: 0),
                    KeyedIntArray(elements: [1], key: 1),
                ],
                "IS(0)"
            ),
            (
                [
                    KeyedIntArray(
                        elements: [
                            0,
                            1,
                            ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            2,
                            3,
                            ],
                        key: 1
                    ),
                ],
                [
                    KeyedIntArray(
                        elements: [
                            3,
                            2,
                            ],
                        key: 1
                    ),
                    KeyedIntArray(
                        elements: [
                            0,
                            1
                        ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            12
                        ],
                        key: 2
                    ),
                ],
                "MS(0,1)IS(2)ME((item: 0, section: 1),(item: 1, section: 0))"
            ),
            (
                [
                    KeyedIntArray(
                        elements: [
                            3,
                            2,
                            ],
                        key: 1
                    ),
                    KeyedIntArray(
                        elements: [
                            0,
                            1
                        ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            12
                        ],
                        key: 2
                    ),
                    ],
                [
                    KeyedIntArray(
                        elements: [
                            0,
                            1,
                            ],
                        key: 0
                    ),
                    KeyedIntArray(
                        elements: [
                            2,
                            3,
                            ],
                        key: 1
                    ),
                    ],
                "MS(0,1)DS(2)ME((item: 0, section: 0),(item: 1, section: 1))"
{'fraction_non_alphanumeric': 0.09345596786129612, 'fraction_numerical': 0.023681150227296756, 'mean_word_length': 0.4778940790501484, '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': '5986947', 'n_tokens_mistral': 2347, 'n_tokens_neox': 2024, 'n_words': 371}