Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Commit

Permalink
Remove operator methods
Browse files Browse the repository at this point in the history
Remove symbol/operator methods from Dot and Of.
  • Loading branch information
NthPortal committed Jun 18, 2017
1 parent 604b29b commit 0d14d27
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 38 deletions.
10 changes: 0 additions & 10 deletions src/main/scala/com/nthportal/versions/Dot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,4 @@ trait Dot[A] {
* @see [[apply]]
*/
final def dot(value: Int): A = apply(value)

/**
* @see [[apply]]
*/
final def :*(value: Int): A = apply(value)

/**
* @see [[apply]]
*/
final def (value: Int): A = apply(value)
}
10 changes: 0 additions & 10 deletions src/main/scala/com/nthportal/versions/Of.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,4 @@ trait Of[D <: Dot[_]] {
* @see [[of]]
*/
final def apply(value: Int): D = of(value)

/**
* @see [[of]]
*/
final def :>(value: Int): D = of(value)

/**
* @see [[of]]
*/
final def (value: Int): D = of(value)
}
6 changes: 2 additions & 4 deletions src/test/scala/com/nthportal/versions/v2/VersionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class VersionTest extends SimpleSpec {
behavior of "Version (2)"

it should "have consistent constructors" in {
val v = Version13
v should equal (Version(1)(3))
v should equal (Version :> 1 :* 3)
val v = Version(1)(3)
v should equal (Version of 1 dot 3)
v should equal (Version(1, 3))
}
Expand All @@ -19,7 +17,7 @@ class VersionTest extends SimpleSpec {
}

it should "compare correctly" in {
val v = Version13
val v = Version(1)(3)

v should be > Version(1)(2)
v should be > Version(0)(9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class VersionFactoryTest extends SimpleSpec {
it should "parse versions correctly" in {
val f = VersionFactory(extensionDef, extensionParser)

f parseVersion "1.3" should equal(Version13 -- Release)
f parseVersion "0.0-SNAPSHOT" should equal(Version00 -- Snapshot)
f parseVersion "1.3" should equal(Version(1)(3) -- Release)
f parseVersion "0.0-SNAPSHOT" should equal(Version(0)(0) -- Snapshot)

a [VersionFormatException] should be thrownBy {f parseVersion "1.0-INVALID"}
a [VersionFormatException] should be thrownBy {f parseVersion "1.0-RELEASE"}
Expand Down
6 changes: 2 additions & 4 deletions src/test/scala/com/nthportal/versions/v3/VersionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class VersionTest extends SimpleSpec {
behavior of "Version (3)"

it should "have consistent constructors" in {
val v = Version125
v should equal (Version(1)(2)(5))
v should equal (Version :> 1 :* 2 :* 5)
val v = Version(1)(2)(5)
v should equal (Version of 1 dot 2 dot 5)
v should equal (Version(1, 2, 5))
}
Expand All @@ -20,7 +18,7 @@ class VersionTest extends SimpleSpec {
}

it should "compare correctly" in {
val v = Version125
val v = Version(1)(2)(5)

v should be > Version(1)(2)(4)
v should be > Version(1)(1)(9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class VersionFactoryTest extends SimpleSpec {
it should "parse versions correctly" in {
val f = VersionFactory(extensionDef, extensionParser)

f parseVersion "1.2.5" should equal(Version125 -- Release)
f parseVersion "0.0.0-SNAPSHOT" should equal(Version000 -- Snapshot)
f parseVersion "1.2.5" should equal(Version(1)(2)(5) -- Release)
f parseVersion "0.0.0-SNAPSHOT" should equal(Version(0)(0)(0) -- Snapshot)

a [VersionFormatException] should be thrownBy {f parseVersion "1.0.0-INVALID"}
a [VersionFormatException] should be thrownBy {f parseVersion "1.0.0-RELEASE"}
Expand Down
6 changes: 2 additions & 4 deletions src/test/scala/com/nthportal/versions/v4/VersionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class VersionTest extends SimpleSpec {
behavior of "Version (4)"

it should "have consistent constructors" in {
val v = Version1254
v should equal (Version(1)(2)(5)(4))
v should equal (Version :> 1 :* 2 :* 5 :* 4)
val v = Version(1)(2)(5)(4)
v should equal (Version of 1 dot 2 dot 5 dot 4)
v should equal (Version(1, 2, 5, 4))
}
Expand All @@ -21,7 +19,7 @@ class VersionTest extends SimpleSpec {
}

it should "compare correctly" in {
val v = Version1254
val v = Version(1)(2)(5)(4)

v should be > Version(1)(2)(5)(3)
v should be > Version(1)(2)(4)(9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class VersionFactoryTest extends SimpleSpec {
it should "parse versions correctly" in {
val f = VersionFactory(extensionDef, extensionParser)

f parseVersion "1.2.5.4" should equal(Version1254 -- Release)
f parseVersion "0.0.0.0-SNAPSHOT" should equal(Version0000 -- Snapshot)
f parseVersion "1.2.5.4" should equal(Version(1)(2)(5)(4) -- Release)
f parseVersion "0.0.0.0-SNAPSHOT" should equal(Version(0)(0)(0)(0) -- Snapshot)

a [VersionFormatException] should be thrownBy {f parseVersion "1.0.0.0-INVALID"}
a [VersionFormatException] should be thrownBy {f parseVersion "1.0.0.0-RELEASE"}
Expand Down

0 comments on commit 0d14d27

Please sign in to comment.