[Snap Framework] heist branch, master, updated. ba587afb81e073e5857365e984afe35267b86822

noreply at snapframework.com noreply at snapframework.com
Thu Apr 22 14:38:33 CDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "heist".

The branch, master has been updated
       via  ba587afb81e073e5857365e984afe35267b86822 (commit)
      from  918f409ad15c2d4795283bc27a8764e955bb2b57 (commit)


Summary of changes:
 src/Text/Templating/Heist.hs              |    7 ++++---
 test/suite/Text/Templating/Heist/Tests.hs |    3 ++-
 test/templates/bar/index.tpl              |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ba587afb81e073e5857365e984afe35267b86822
Author: Mighty Byte <mightybyte at gmail.com>
Date:   Thu Apr 22 15:38:18 2010 -0400

    Fixed some test cases.

diff --git a/src/Text/Templating/Heist.hs b/src/Text/Templating/Heist.hs
index a71c6e0..717df50 100644
--- a/src/Text/Templating/Heist.hs
+++ b/src/Text/Templating/Heist.hs
@@ -378,7 +378,7 @@ applyImpl = do
       
 -- | The default set of built-in splices.
 defaultSpliceMap :: Monad m => SpliceMap m
-defaultSpliceMap = Map.fromList $ map (\(a,b) -> (B.append "snap:" a, b))
+defaultSpliceMap = Map.fromList
   [(applyTag, applyImpl)
   ,(bindTag, bindImpl)
   ]
@@ -406,11 +406,12 @@ mapLeft g = either (Left . g) Right
 loadTemplate :: String -> String -> IO TemplateMap
 loadTemplate path fname
   | ".tpl" `isSuffixOf` fname = do
---    putStrLn $ "Reading "++fname++" as "++tName
+    putStrLn $ "Reading "++fname++" as "++tName
     c <- getDoc fname
+    print c
     return $ either (const Map.empty) (Map.singleton (splitPaths $ B.pack tName) . (:[])) c
   | otherwise = do
---    putStrLn $ "Skipping "++fname
+    putStrLn $ "Skipping "++fname
     return Map.empty
   where tName = drop ((length path)+1) $ take ((length fname) - 4) fname
 
diff --git a/test/suite/Text/Templating/Heist/Tests.hs b/test/suite/Text/Templating/Heist/Tests.hs
index 1211b63..b41281e 100644
--- a/test/suite/Text/Templating/Heist/Tests.hs
+++ b/test/suite/Text/Templating/Heist/Tests.hs
@@ -55,7 +55,8 @@ loadTest :: H.Assertion
 loadTest = do
   tm <- liftM _templateMap $ (loadTemplates "templates" :: IO (TemplateState IO))
   print $ Map.size tm
-  H.assertBool "loadTest size" $ Map.size tm == 3
+  print $ tm
+  H.assertBool "loadTest size" $ Map.size tm == 12
 
 getDocTest :: H.Assertion
 getDocTest = do
diff --git a/test/templates/bar/index.tpl b/test/templates/bar/index.tpl
index 8729119..959a0cd 100644
--- a/test/templates/bar/index.tpl
+++ b/test/templates/bar/index.tpl
@@ -1 +1 @@
-/bar/index
+<root>/bar/index</root>
-----------------------------------------------------------------------


hooks/post-receive
-- 
heist


More information about the Snap mailing list