Skip to content

Commit

Permalink
Fixed #1234: Corrected debug value for java.util.concurrent.TimeUnit.…
Browse files Browse the repository at this point in the history
…MINUTES (#1235)
  • Loading branch information
davidak09 authored Dec 15, 2023
1 parent 6904dfd commit 82817cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core-tests/shared/src/test/scala/zio/prelude/DebugSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,16 @@ object DebugSpec extends ZIOBaseSpec {
}
),
suite("Duration")(
test("ZIO") {
test("ZIOMillis") {
import zio._
val duration = 3.millis
assert(duration.debug.render)(equalTo("Duration(amount = 3L, unit = MILLISECONDS)"))
},
test("ZIOMinutes") {
import zio._
val duration = 42.minutes
assert(duration.debug.render)(equalTo("Duration(amount = 42L, unit = MINUTES)"))
},
test("Scala") {
import scala.concurrent.duration._
val duration = 42.days
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/zio/prelude/Debug.scala
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ object Debug extends DebugVersionSpecific {
case TimeUnit.MICROSECONDS => "MICROSECONDS"
case TimeUnit.MILLISECONDS => "MILLISECONDS"
case TimeUnit.SECONDS => "SECONDS"
case TimeUnit.MINUTES => "SECONDS"
case TimeUnit.MINUTES => "MINUTES"
case TimeUnit.HOURS => "HOURS"
case TimeUnit.DAYS => "DAYS"
}
Expand Down

0 comments on commit 82817cd

Please sign in to comment.