Skip to content

Commit cf20457

Browse files
committed
chore: remove unused code
1 parent 1e77f43 commit cf20457

File tree

2 files changed

+0
-64
lines changed

2 files changed

+0
-64
lines changed

src/main/kotlin/com/coder/gateway/sdk/CoderSemVer.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ class CoderSemVer(private val major: Long = 0, private val minor: Long = 0, priv
1010
}
1111

1212
fun isInClosedRange(start: CoderSemVer, endInclusive: CoderSemVer) = this in start..endInclusive
13-
fun isCompatibleWith(other: CoderSemVer): Boolean {
14-
// in the initial development phase minor changes when there are API incompatibilities
15-
if (this.major == 0L) {
16-
if (other.major > 0) return false
17-
return this.minor == other.minor
18-
}
19-
return this.major <= other.major
20-
}
2113

2214

2315
override fun toString(): String {

src/test/groovy/CoderSemVerTest.groovy

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.coder.gateway.sdk
22

3-
import spock.lang.Ignore
4-
53
class CoderSemVerTest extends spock.lang.Specification {
64

75
def 'semver versions are valid'() {
@@ -157,58 +155,4 @@ class CoderSemVerTest extends spock.lang.Specification {
157155
'v2147483647.2147483647.2147483647' || new CoderSemVer(2147483647L, 2147483647L, 2147483647L)
158156
'v1.0.0-0A.is.legal' || new CoderSemVer(1L, 0L, 0L)
159157
}
160-
161-
@Ignore
162-
def 'two initial development versions are compatible when first minor is equal to the second minor'() {
163-
expect:
164-
new CoderSemVer(0, 1).isCompatibleWith(new CoderSemVer(0, 1))
165-
}
166-
167-
@Ignore
168-
def 'two initial development versions are not compatible when first minor is less than the second minor'() {
169-
expect:
170-
!new CoderSemVer(0, 1).isCompatibleWith(new CoderSemVer(0, 2))
171-
}
172-
173-
@Ignore
174-
def 'two initial development versions are not compatible when first minor is bigger than the second minor'() {
175-
expect:
176-
!new CoderSemVer(0, 2).isCompatibleWith(new CoderSemVer(0, 1))
177-
}
178-
179-
@Ignore
180-
def 'versions are not compatible when one version is initial phase of development and the other is not, even though the minor is the same'() {
181-
expect:
182-
!new CoderSemVer(0, 2).isCompatibleWith(new CoderSemVer(1, 2))
183-
184-
and:
185-
!new CoderSemVer(1, 2).isCompatibleWith(new CoderSemVer(0, 2))
186-
}
187-
188-
@Ignore
189-
def 'two versions which are not in development phase are compatible when first major is less or equal to the other, regardless of the minor'() {
190-
expect: 'versions compatible when same major and same minor'
191-
new CoderSemVer(1, 1).isCompatibleWith(new CoderSemVer(1, 1))
192-
193-
and: 'they are also compatible when major is the same but minor is different'
194-
new CoderSemVer(1, 1).isCompatibleWith(new CoderSemVer(1, 2))
195-
196-
and: 'they are also compatible when first major is less than the second major but with same minor'
197-
new CoderSemVer(1, 1).isCompatibleWith(new CoderSemVer(2, 1))
198-
199-
and: 'they are also compatible when first major is less than the second major and also with a different minor'
200-
new CoderSemVer(1, 1).isCompatibleWith(new CoderSemVer(2, 2))
201-
}
202-
203-
@Ignore
204-
def 'two versions which are not in development phase are not compatible when first major is greater than the second major, regardless of the minor'() {
205-
expect: 'versions are not compatible when first major is bigger than the second but with same minor'
206-
!new CoderSemVer(2, 1).isCompatibleWith(new CoderSemVer(1, 1))
207-
208-
and: 'they are also not compatible when minor first minor is less than the second minor'
209-
!new CoderSemVer(2, 1).isCompatibleWith(new CoderSemVer(1, 2))
210-
211-
and: 'also also not compatible when minor first minor is bigger than the second minor'
212-
!new CoderSemVer(2, 3).isCompatibleWith(new CoderSemVer(1, 2))
213-
}
214158
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy