Skip to content

Commit

Permalink
Some cleanup work, style & test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Apr 3, 2012
1 parent c1ed308 commit 84b4160
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .ghci
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:set -ibenchmarks -itests -iutil -ilib/binary-0.5.0.2/src -idoc/examples
:set -ibenchmarks -isrc -itests
18 changes: 9 additions & 9 deletions blaze-html.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: blaze-html
Version: 0.4.4.0
Version: 0.5.0.0
Homepage: http://jaspervdj.be/blaze
Bug-Reports: https://github.com/jaspervdj/blaze-html/issues
License: BSD3
Expand Down Expand Up @@ -46,9 +46,9 @@ Library
Build-depends:
base >= 4 && < 5,
blaze-builder >= 0.2 && < 0.4,
blaze-markup >= 0.1 && < 0.2,
text >= 0.10 && < 0.12,
bytestring >= 0.9 && < 0.10
blaze-markup >= 0.5 && < 0.6,
bytestring >= 0.9 && < 0.10,
text >= 0.10 && < 0.12

Test-suite blaze-html-tests
Type: exitcode-stdio-1.0
Expand All @@ -57,9 +57,8 @@ Test-suite blaze-html-tests
Ghc-options: -Wall

Other-modules:
Text.Blaze.Tests
Text.Blaze.Tests.Cases
Text.Blaze.Tests.Util
Text.Blaze.Html.Tests
Text.Blaze.Html.Tests.Util
Util.Tests

Build-depends:
Expand All @@ -72,8 +71,9 @@ Test-suite blaze-html-tests
-- Copied from regular dependencies...
base >= 4 && < 5,
blaze-builder >= 0.2 && < 0.4,
text >= 0.10 && < 0.12,
bytestring >= 0.9 && < 0.10
blaze-markup >= 0.5 && < 0.6,
bytestring >= 0.9 && < 0.10,
text >= 0.10 && < 0.12

Source-repository head
Type: git
Expand Down
11 changes: 7 additions & 4 deletions src/Text/Blaze/Html.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{-# LANGUAGE NoMonomorphismRestriction, RankNTypes #-}
module Text.Blaze.Html where
module Text.Blaze.Html
( module Text.Blaze
, Html
, toHtml
) where

import Text.Blaze

type Html = Markup

toHtml :: forall a. ToMarkup a => a -> Markup
toHtml = toMarkup
toHtml :: ToMarkup a => a -> Markup
toHtml = toMarkup
9 changes: 4 additions & 5 deletions src/Util/GenerateHtmlCombinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ writeHtmlVariant htmlVariant = do
, "{-# LANGUAGE OverloadedStrings #-}"
, "-- | This module exports HTML combinators used to create documents."
, "--"
, exportList modulName $ "module Text.Blaze"
: "module Text.Blaze.Html"
: "docType"
: "docTypeHtml"
: map (sanitize . fst) sortedTags
, exportList modulName $ "module Text.Blaze.Html"
: "docType"
: "docTypeHtml"
: map (sanitize . fst) sortedTags
, DO_NOT_EDIT
, "import Prelude ((>>), (.))"
, ""
Expand Down
4 changes: 2 additions & 2 deletions tests/TestSuite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module Main where

import Test.Framework (defaultMain, testGroup)

import qualified Text.Blaze.Tests.Cases
import qualified Text.Blaze.Html.Tests
import qualified Util.Tests

main :: IO ()
main = defaultMain
[ testGroup "Text.Blaze.Tests.Cases" Text.Blaze.Tests.Cases.tests
[ testGroup "Text.Blaze.Html.Tests" Text.Blaze.Html.Tests.tests
, testGroup "Util.Tests" Util.Tests.tests
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- | A whole bunch of simple test cases
--
{-# LANGUAGE OverloadedStrings #-}
module Text.Blaze.Tests.Cases
module Text.Blaze.Html.Tests
( tests
) where

Expand All @@ -15,11 +15,10 @@ import Test.Framework.Providers.HUnit (testCase)
import Test.Framework (Test)
import qualified Data.ByteString.Lazy.Char8 as LBC

import Text.Blaze
import Text.Blaze.Html.Tests.Util
import Text.Blaze.Html5 hiding (map)
import qualified Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes
import Text.Blaze.Tests.Util
import qualified Text.Blaze.Html5 as H

-- | Type for a simple HTML test. This data type contains the expected output
-- and the HTML template.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- | Utility functions for the blaze tests
--
module Text.Blaze.Tests.Util
module Text.Blaze.Html.Tests.Util
( renderUsingString
, renderUsingText
, renderUsingUtf8
Expand Down

0 comments on commit 84b4160

Please sign in to comment.