fix cache test

This commit is contained in:
Mark Harrah 2010-11-09 20:43:58 -05:00
parent f788437164
commit bbf9bc679e
2 changed files with 18 additions and 0 deletions

16
cache/Cache.scala vendored
View File

@ -188,6 +188,22 @@ trait HListCacheImplicits
}
implicit def hNilCache: InputCache[HNil] = Cache.singleton(HNil : HNil)
implicit def hConsFormat[H, T <: HList](implicit head: Format[H], tail: Format[T]): Format[H :+: T] = new Format[H :+: T] {
def reads(from: Input) =
{
val h = head.reads(from)
val t = tail.reads(from)
HCons(h, t)
}
def writes(to: Output, hc: H :+: T)
{
head.writes(to, hc.head)
tail.writes(to, hc.tail)
}
}
implicit def hNilFormat: Format[HNil] = asSingleton(HNil)
}
trait UnionImplicits
{

View File

@ -10,6 +10,8 @@ object CacheTest// extends Properties("Cache test")
import Cache._
import FileInfo.hash._
import Ordering._
import sbinary.DefaultProtocol.FileFormat
def test
{
lazy val create = new File("test")