Skip to content

Commit

Permalink
Add failing test based on issue cb372#90
Browse files Browse the repository at this point in the history
  • Loading branch information
cb372 authored and lloydmeta committed Apr 9, 2016
1 parent fa6e27e commit 79668de
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions caffeine/src/test/scala/foo/Issue90Spec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package foo

import org.scalatest._

/**
* Replicating the issue reported in https://github.com/cb372/scalacache/issues/90
*/
class Issue90Spec extends FlatSpec with Matchers {

"Issue 90" should "be fixed" in {
import scalacache._
import caffeine._
import scala.concurrent.duration._

implicit val scalaCache = ScalaCache(CaffeineCache())

def baz(): Seq[foo.Bar] = Seq(
Bar(1, "one"),
Bar(2, "two")
)
val ttl = 1.second

"""
def logic(): Seq[foo.Bar] = sync.cachingWithTTL("the-key")(ttl)(baz())
""" should compile
}

}

case class Bar(a: Int, b: String)

0 comments on commit 79668de

Please sign in to comment.