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

scoverage / sbt-scoverage-samples / #47

pending completion
#47

push

Roland Tritsch
Add sys.props to configure plugin versions (to support sbt-test ...

96 of 126 relevant lines covered (76.19%)

0.76 hits per line

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

72.73
/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 {
1✔
22
      s <- Future.successful("mystery")
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")
1✔
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