• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scoverage / sbt-scoverage-samples / 4741723636

19 Apr 2023 09:30AM CUT coverage: 66.912% (-5.6%) from 72.477%
4741723636

push

Roland Tritsch
Even more time to shut down.

91 of 136 relevant lines covered (66.91%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.64
/src/main/scala/org/scoverage/samples/QuoteGenerator.scala
1
package org.scoverage.samples
2

3
import scala.util.Random
4
import scala.concurrent.Future
5

6
trait QuoteGenerator {
7
  def generate: SpotQuote
8
}
9

10
class RandomQuoteGenerator extends QuoteGenerator {
11

×
12
  def this(flibble: String) = {
×
13
    this()
×
14
    println("A fantastic constructor")
15
  }
16

1✔
17
  def generate: SpotQuote = {
18

19
    import scala.concurrent.ExecutionContext.Implicits.global
20
    // I want to test for loops, this seems like a good place to waste some cycles
1✔
21
    for {
×
22
      s <- Future.successful("mystery")
1✔
23
      t <- Future.successful("machine")
24
    } yield {
25
      "yield me"
26
    }
27

28
    SpotQuote(
1✔
29
      InstrumentLoader.randomInstrument,
1✔
30
      if (System.currentTimeMillis() == 0) new Currency("Flibble")
31
      else new Currency("USD"),
1✔
32
      BigDecimal.valueOf(Random.nextDouble() * 100),
1✔
33
      BigDecimal.valueOf(Random.nextDouble() * 100)
34
    )
35
  }
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc