Tusker/Packages/InstanceFeatures/Tests/InstanceFeaturesTests/VersionTests.swift

28 lines
674 B
Swift
Raw Normal View History

//
// VersionTests.swift
// InstanceFeaturesTests
//
// Created by Shadowfacts on 4/2/22.
// Copyright © 2022 Shadowfacts. All rights reserved.
//
import XCTest
@testable import InstanceFeatures
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))
}
}