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

scoverage / sbt-scoverage-samples / 12961978118

05 Nov 2023 02:28PM CUT coverage: 93.289%. First build
12961978118

Pull #352

rolandtritsch
Update test file to latest version.
Pull Request #352:

278 of 298 relevant lines covered (93.29%)

2.19 hits per line

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

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

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

28
    SpotQuote(
4✔
29
      InstrumentLoader.randomInstrument,
4✔
30
      if (System.currentTimeMillis() == 0) new Currency("Flibble")
31
      else new Currency("USD"),
4✔
32
      BigDecimal.valueOf(Random.nextDouble() * 100),
4✔
33
      BigDecimal.valueOf(Random.nextDouble() * 100)
2✔
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