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

scoverage / sbt-scoverage-samples / #60

08 Apr 2023 02:29AM CUT coverage: 71.963% (+7.3%) from 64.706%
#60

push

rolandtritsch
Even more time to shut down.

77 of 107 relevant lines covered (71.96%)

0.72 hits per line

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

66.67
/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

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
21
    for {
22
      s <- Future.successful("mystery")
1✔
23
      t <- Future.successful("machine")
1✔
24
    } yield {
25
      "yield me"
1✔
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)
1✔
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