Sha256: da8784a2097e3145d166a2c5546b43098d4040fb07bddc7acbc802e7c968b729

Contents?: true

Size: 912 Bytes

Versions: 71

Compression:

Stored size: 912 Bytes

Contents

#if swift(>=3.0)
    import XCTest
#endif

class TrinaryTest: XCTestCase {

    func testTrinary1IsDecimal1() {
        XCTAssertEqual(1, Int(Trinary("1")))
    }

    func testTrinary2IsDecimal2() {
        XCTAssertEqual(2, Int(Trinary("2")))
    }

    func testTrinary10IsDecimal3() {
        XCTAssertEqual(3, Int(Trinary("10")))
    }

    func testTrinary11IsDecimal4() {
        XCTAssertEqual(4, Int(Trinary("11")))
    }

    func testTrinary100IsDecimal9() {
        XCTAssertEqual(9, Int(Trinary("100")))
    }

    func testTrinary112IsDecimal14() {
        XCTAssertEqual(14, Int(Trinary("112")))
    }

    func testTrinary222Is26() {
        XCTAssertEqual(26, Int(Trinary("222")))
    }

    func testTrinary1122000120Is32091() {
        XCTAssertEqual(32091, Int(Trinary("1122000120")))
    }

    func testInvalidTrinaryIsDecimal0() {
        XCTAssertEqual(0, Int(Trinary("carrot")))
    }
}

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
trackler-2.0.5.14 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.13 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.12 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.11 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.10 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.9 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.8 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.7 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.6 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.5 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.4 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.3 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.2 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.1 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.5.0 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.4.0 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.3.9 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.3.8 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.3.7 tracks/swift/exercises/trinary/TrinaryTest.swift
trackler-2.0.3.6 tracks/swift/exercises/trinary/TrinaryTest.swift