28 lines
654 B
Swift
28 lines
654 B
Swift
//
|
|
// VersionTests.swift
|
|
// TuskerTests
|
|
//
|
|
// Created by Shadowfacts on 4/2/22.
|
|
// Copyright © 2022 Shadowfacts. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
@testable import Tusker
|
|
|
|
class VersionTests: XCTestCase {
|
|
|
|
typealias Version = InstanceFeatures.Version
|
|
|
|
func testParseVersion() {
|
|
XCTAssertEqual(Version(string: "1.2.3"), Version(1, 2, 3))
|
|
XCTAssertEqual(Version(string: "asdf"), nil)
|
|
}
|
|
|
|
func testComparison() {
|
|
XCTAssertLessThan(Version(1, 2, 3), Version(1, 2, 4))
|
|
XCTAssertLessThan(Version(1, 2, 3), Version(1, 3, 0))
|
|
XCTAssertLessThan(Version(1, 2, 3), Version(2, 0, 0))
|
|
}
|
|
|
|
}
|