mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
22 lines
585 B
Swift
22 lines
585 B
Swift
import Testing
|
|
@testable import OpenClaw
|
|
|
|
struct SemverTests {
|
|
@Test func `comparison orders by major minor patch`() {
|
|
let a = Semver(major: 1, minor: 0, patch: 0)
|
|
let b = Semver(major: 1, minor: 1, patch: 0)
|
|
let c = Semver(major: 1, minor: 1, patch: 1)
|
|
let d = Semver(major: 2, minor: 0, patch: 0)
|
|
|
|
#expect(a < b)
|
|
#expect(b < c)
|
|
#expect(c < d)
|
|
#expect(d > a)
|
|
}
|
|
|
|
@Test func `description matches parts`() {
|
|
let v = Semver(major: 3, minor: 2, patch: 1)
|
|
#expect(v.description == "3.2.1")
|
|
}
|
|
}
|