Merge branch 'master' of github.com:yesodweb/yesod

This commit is contained in:
Luite Stegeman 2012-02-03 14:04:30 +01:00
commit 6178d1219f

View File

@ -7,6 +7,7 @@
{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE CPP #-}
import Test.Hspec.Monadic import Test.Hspec.Monadic
import Test.Hspec.HUnit () import Test.Hspec.HUnit ()
import Test.HUnit ((@?=)) import Test.HUnit ((@?=))
@ -72,7 +73,13 @@ data MyApp = MyApp
data MySub = MySub data MySub = MySub
instance RenderRoute MySub where instance RenderRoute MySub where
data Route MySub = MySubRoute ([Text], [(Text, Text)]) data
#if MIN_VERSION_base(4,7,0)
Route
#else
YRC.Route
#endif
MySub = MySubRoute ([Text], [(Text, Text)])
deriving (Show, Eq, Read) deriving (Show, Eq, Read)
renderRoute (MySubRoute x) = x renderRoute (MySubRoute x) = x
@ -81,7 +88,13 @@ getMySub MyApp = MySub
data MySubParam = MySubParam Int data MySubParam = MySubParam Int
instance RenderRoute MySubParam where instance RenderRoute MySubParam where
data Route MySubParam = ParamRoute Char data
#if MIN_VERSION_base(4,7,0)
Route
#else
YRC.Route
#endif
MySubParam = ParamRoute Char
deriving (Show, Eq, Read) deriving (Show, Eq, Read)
renderRoute (ParamRoute x) = ([singleton x], []) renderRoute (ParamRoute x) = ([singleton x], [])
@ -286,7 +299,7 @@ main = hspecX $ do
it "catches overlapping multi" $ do it "catches overlapping multi" $ do
let routes = [parseRoutesNoCheck| let routes = [parseRoutesNoCheck|
/foo Foo1 /foo Foo1
/*Strings Foo2 /##*Strings Foo2
|] |]
findOverlapNames routes @?= [("Foo1", "Foo2")] findOverlapNames routes @?= [("Foo1", "Foo2")]
it "catches overlapping subsite" $ do it "catches overlapping subsite" $ do