Skip to content

Commit

Permalink
Reformat exemplar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcardell committed May 10, 2023
1 parent 49f9f27 commit 481a1ea
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,31 @@ class HistogramSpec extends munit.CatsEffectSuite {
}

test("Histogram: observe with exemplars (map)") {
val test = for {
val setup = for {
cr <- CollectorRegistry.build[IO]
h <- Histogram.noLabels(cr, Name("boo"), "Boo ")
_ <- h.observeWithExemplar(0.1, Map("exemplar1" -> "value1"))
} yield h

val test = for {
h <- setup
_ <- h.observeWithExemplar(0.1, Map("exemplar1" -> "value1"))
} yield ()

test.attempt.map(_.isRight).assert

}

test("Histogram: observe with exemplars (tuples)") {
val test = for {
val setup = for {
cr <- CollectorRegistry.build[IO]
h <- Histogram.noLabels(cr, Name("boo"), "Boo ")
_ <- h.observeWithExemplar(0.1, "exemplar1" -> "value1")
} yield h

val test = for {
h <- setup
_ <- h.observeWithExemplar(0.1, "exemplar1" -> "value1")
} yield ()

test.attempt.map(_.isRight).assert

}
Expand Down

0 comments on commit 481a1ea

Please sign in to comment.