2022-04-02 13:18:14 -04:00
|
|
|
//
|
|
|
|
// VersionTests.swift
|
2023-03-05 14:52:19 -05:00
|
|
|
// InstanceFeaturesTests
|
2022-04-02 13:18:14 -04:00
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 4/2/22.
|
|
|
|
// Copyright © 2022 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
2023-03-05 14:52:19 -05:00
|
|
|
@testable import InstanceFeatures
|
2022-04-02 13:18:14 -04:00
|
|
|
|
|
|
|
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))
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|