Sha256: 4cc3ac0dce7ce120c4dda1f79cf296364b4a946b9353ddc1cff4dc4232e28312

Contents?: true

Size: 1.5 KB

Versions: 325

Compression:

Stored size: 1.5 KB

Contents

import XCTest
@testable import PrimeFactors

class PrimeFactorsTests: XCTestCase {
    func test1() {
        XCTAssertEqual([], PrimeFactors(1).toArray)
    }

    func test2() {
        XCTAssertEqual([2], PrimeFactors(2).toArray)
    }

    func test3() {
        XCTAssertEqual([3], PrimeFactors(3).toArray)
    }

    func test4() {
        XCTAssertEqual([2, 2], PrimeFactors(4).toArray)
    }

    func test6() {
        XCTAssertEqual([2, 3], PrimeFactors(6).toArray)
    }

    func test8() {
        XCTAssertEqual([2, 2, 2], PrimeFactors(8).toArray)
    }

    func test9() {
        XCTAssertEqual([3, 3], PrimeFactors(9).toArray)
    }

    func test27() {
        XCTAssertEqual([3, 3, 3], PrimeFactors(27).toArray)
    }

    func test625() {
        XCTAssertEqual([5, 5, 5, 5], PrimeFactors(625).toArray)
    }

    func test901255() {
        XCTAssertEqual([5, 17, 23, 461], PrimeFactors(901_255).toArray)
    }

    func test93819012551() {
        XCTAssertEqual([11, 9539, 894_119], PrimeFactors(93_819_012_551).toArray)
    }

    static var allTests: [(String, (PrimeFactorsTests) -> () throws -> Void)] {
        return [
            ("test1", test1),
            ("test2", test2),
            ("test3", test3),
            ("test4", test4),
            ("test6", test6),
            ("test8", test8),
            ("test9", test9),
            ("test27", test27),
            ("test625", test625),
            ("test901255", test901255),
            ("test93819012551", test93819012551),
        ]
    }
}

Version data entries

325 entries across 325 versions & 1 rubygems

Version Path
trackler-2.0.6.40 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.39 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.38 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.37 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.36 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.35 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.34 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.33 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.32 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.31 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.30 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.29 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.28 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.27 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.26 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.25 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.24 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.23 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.22 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift
trackler-2.0.6.21 tracks/swift/exercises/prime-factors/Tests/PrimeFactorsTests/PrimeFactorsTests.swift