<commit_before>//
//  PromiseZipTests.swift
//  Promise
//
//  Created by <NAME> on 8/19/16.
//
//

import XCTest
import Foundation

import Promise

class PromiseZipTests: XCTestCase {
    func testZipping2() {
        weak var expectation = self.expectation(description: "`Promises.zip` should be type safe.")

        let promise = Promise(value: 2)
        let promise2 = Promise(value: "some string")
        let zipped = Promises.zip(promise, promise2)
        zipped.always({
            expectation?.fulfill()
        })
        
        waitForExpectations(timeout: 1, handler: nil)
        guard let tuple = zipped.value else { XCTFail(); return }
        XCTAssertEqual(tuple.0, 2)
        XCTAssertEqual(tuple.1, "some string")
    }
}
<commit_msg>Add a test for multiple parameter zip<commit_after>//
//  PromiseZipTests.swift
//  Promise
//
//  Created by <NAME> on 8/19/16.
//
//

import XCTest
import Foundation

import Promise

class PromiseZipTests: XCTestCase {
    func testZipping2() {
        weak var expectation = self.expectation(description: "`Promises.zip` should be type safe.")

        let promise = Promise(value: 2)
        let promise2 = Promise(value: "some string")
        let zipped = Promises.zip(promise, promise2)
        zipped.always({
            expectation?.fulfill()
        })
        
        waitForExpectations(timeout: 1, handler: nil)
        guard let tuple = zipped.value else { XCTFail(); return }
        XCTAssertEqual(tuple.0, 2)
        XCTAssertEqual(tuple.1, "some string")
    }

    func testMultipleParameters() {
        // The >2 parameter variants of zip are all generated, so testing one
        // *should* mean all others work too.

        weak var expectation = self.expectation(description: "`Promises.zip` should be type safe.")

        let promise = Promise(value: 2)
        let promise2 = Promise(value: "some string")
        let promise3 = Promise(value: [1, 1, 2, 3, 5])
        let promise4 = Promise(value: ["two", "strings"])
        let zipped = Promises.zip(promise, promise2, promise3, promise4)
        zipped.always({
            expectation?.fulfill()
        })

        waitForExpectations(timeout: 1, handler: nil)
        guard let tuple = zipped.value else { XCTFail(); return }
        XCTAssertEqual(tuple.0, 2)
        XCTAssertEqual(tuple.1, "some string")
        XCTAssertEqual(tuple.2, [1, 1, 2, 3, 5])
        XCTAssertEqual(tuple.3, ["two", "strings"])
    }
}

{'fraction_non_alphanumeric': 0.11688311688311688, 'fraction_numerical': 0.020292207792207792, 'mean_word_length': 2.4572230014025247, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6324768', 'n_tokens_mistral': 768, 'n_tokens_neox': 731, 'n_words': 208}