@@ -124,8 +124,7 @@ final class SemanticVersionTests: XCTestCase {
124
124
XCTAssert ( SemanticVersion ( 1 , 0 , 0 ) < SemanticVersion ( 1 , 1 , 0 ) )
125
125
XCTAssert ( SemanticVersion ( 1 , 0 , 0 ) < SemanticVersion ( 1 , 0 , 1 ) )
126
126
XCTAssert ( SemanticVersion ( 1 , 0 , 0 , " a " ) < SemanticVersion ( 1 , 0 , 0 , " b " ) )
127
- XCTAssertLessThan ( SemanticVersion ( 1 , 0 , 0 , " alpha.2 " ) , SemanticVersion ( 1 , 0 , 0 , " alpha.11 " ) )
128
- XCTAssertLessThan ( SemanticVersion ( 1 , 0 , 0 , " alpha.2 " ) , SemanticVersion ( 1 , 0 , 0 , " alpha.2.1 " ) )
127
+ XCTAssertFalse ( SemanticVersion ( 1 , 0 , 0 , " a " , " a " ) < SemanticVersion ( 1 , 0 , 0 , " a " , " b " ) )
129
128
130
129
// ensure betas come before releases
131
130
XCTAssert ( SemanticVersion ( 1 , 0 , 0 , " b1 " ) < SemanticVersion ( 1 , 0 , 0 ) )
@@ -135,10 +134,8 @@ final class SemanticVersionTests: XCTestCase {
135
134
// once the patch bumps up to the beta level again, it sorts higher
136
135
XCTAssert ( SemanticVersion ( 1 , 0 , 1 ) > SemanticVersion ( 1 , 0 , 1 , " b1 " ) )
137
136
138
- // Ensure metadata is not considered
139
- XCTAssertFalse ( SemanticVersion ( 1 , 0 , 0 , " a " , " a " ) < SemanticVersion ( 1 , 0 , 0 , " a " , " b " ) )
140
- XCTAssertFalse ( SemanticVersion ( 1 , 0 , 0 , " a " , " a " ) > SemanticVersion ( 1 , 0 , 0 , " a " , " b " ) )
141
- XCTAssertLessThan ( SemanticVersion ( 1 , 0 , 0 , " alpha " , " build1 " ) , SemanticVersion ( 1 , 0 , 0 , " " , " build1 " ) )
137
+ // Ensure a release with build metadata sorts above a pre-release
138
+ XCTAssert ( SemanticVersion ( 1 , 0 , 1 , " alpha " ) < SemanticVersion ( 1 , 0 , 1 , " " , " build.14 " ) )
142
139
}
143
140
144
141
func test_isStable( ) throws {
@@ -147,7 +144,6 @@ final class SemanticVersionTests: XCTestCase {
147
144
XCTAssert ( SemanticVersion ( 1 , 0 , 0 , " " , " " ) . isStable)
148
145
XCTAssertFalse ( SemanticVersion ( 1 , 0 , 0 , " a " ) . isStable)
149
146
XCTAssertTrue ( SemanticVersion ( 1 , 0 , 0 , " " , " a " ) . isStable)
150
- XCTAssertFalse ( SemanticVersion ( 1 , 0 , 0 , " a " , " b " ) . isStable)
151
147
}
152
148
153
149
func test_isMajorRelease( ) throws {
0 commit comments