diff --git a/.gitignore b/.gitignore index 7af9867..5d2af1f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ project/target/ project/project/ modules/core/target/ .version +.scala-version diff --git a/build.sbt b/build.sbt index 859e587..8f239d2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -val scala3: String = "3.6.4" +val scala3: String = "3.7.1" ThisBuild / scalaVersion := scala3 ThisBuild / versionScheme := Some("semver-spec") @@ -20,7 +20,7 @@ val sharedSettings = Seq( lazy val testSettings = Seq( libraryDependencies ++= Seq( - "org.scalameta" %% "munit" % "1.1.0" % Test + "org.scalameta" %% "munit" % "1.1.1" % Test ) ) diff --git a/project/build.properties b/project/build.properties index cc68b53..bbb0b60 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.11 +sbt.version=1.11.2 diff --git a/project/plugins.sbt b/project/plugins.sbt index 809dbbe..95ffa71 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -25,9 +25,10 @@ credentials += selectCredentials() externalResolvers := Seq( "Garrity Software Mirror" at "https://maven.garrity.co/releases", + "Garrity Software Snapshots" at "https://maven.garrity.co/snapshots", "Garrity Software Releases" at "https://maven.garrity.co/gs" ) addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0") -addSbtPlugin("gs" % "sbt-garrity-software" % "0.5.0") +addSbtPlugin("gs" % "sbt-garrity-software" % "0.6.0") addSbtPlugin("gs" % "sbt-gs-semver" % "0.3.0") diff --git a/src/main/scala/gs/uuid/v0/UUID.scala b/src/main/scala/gs/uuid/v0/UUID.scala index 548fea4..a4d29fe 100644 --- a/src/main/scala/gs/uuid/v0/UUID.scala +++ b/src/main/scala/gs/uuid/v0/UUID.scala @@ -118,7 +118,8 @@ object UUID: * @return * Hexadecimal string representation of this UUID. */ - def str(dashes: Boolean = false): String = withoutDashes() + def str(dashes: Boolean = false): String = + if dashes then withDashes() else withoutDashes() /** @return * Hexadecimal string representation of this UUID, without dashes. diff --git a/src/test/scala/gs/uuid/v0/UUIDTests.scala b/src/test/scala/gs/uuid/v0/UUIDTests.scala index 3b80518..e4b66d4 100644 --- a/src/test/scala/gs/uuid/v0/UUIDTests.scala +++ b/src/test/scala/gs/uuid/v0/UUIDTests.scala @@ -56,6 +56,14 @@ class UUIDTests extends munit.FunSuite: assertEquals(UUID.parse(base.withDashes()), Some(base)) } + test( + "should successfully parse a UUID with dashes (alternative serializer)" + ) { + val raw = java.util.UUID.randomUUID() + val base = UUID(raw) + assertEquals(UUID.parse(base.str(true)), Some(base)) + } + test( "should successfully parse a UUID with dashes, generated with this library" ) {