Commits

Anonymous committed 1ed87dc

Fix up the tests a bit

  • Participants
  • Parent commits 70f96f8

Comments (0)

Files changed (10)

Data/Text/Utf32/Fusion.hs

-{-# OPTIONS_GHC -fbang-patterns #-}
+{-# LANGUAGE BangPatterns #-}
 
-module Text.Utf32.Fusion where
+module Data.Text.Utf32.Fusion where
     
-import Text.Fusion hiding (stream, unstream)
-import Text.Utf32.Internal
-import Text.UnsafeChar
+import Data.Text.Fusion hiding (stream, unstream)
+import Data.Text.Utf32.Internal
+import Data.Text.UnsafeChar
 import Data.Array.Base
 import Data.Word
 import Data.Array.ST

Data/Text/Utf32/Internal.hs

-{-# OPTIONS_GHC -fglasgow-exts #-}
-
-module Text.Utf32.Internal where
+module Data.Text.Utf32.Internal where
 
 import Data.Array.Unboxed
 import Data.Word
 
-data Text = Text !(UArray Int Word32) !Int !Int
+data Text = Text !(UArray Int Word32) !Int !Int

Data/Text/Utf8/Fusion.hs

-{-# OPTIONS_GHC -fbang-patterns -fglasgow-exts #-}
+{-# LANGUAGE BangPatterns #-}
 
-module Text.Utf8.Fusion where
+module Data.Text.Utf8.Fusion where
 
 import Data.Array.Base
 import Data.Word
 import Control.Monad.ST
 import Data.Text.UnsafeChar
 import Control.Monad
-import Char
+import Data.Char
 
-import Text.Utf8
-import Text.Utf8.Internal
-import Text.Fusion hiding (stream,unstream)
+import Data.Text.Utf8
+import Data.Text.Utf8.Internal
+import Data.Text.Fusion hiding (stream,unstream)
 
 stream :: Text -> Stream Char
 stream (Text arr off len) = Stream next off len
 {-# RULES 
 "STREAM stream/unstream fusion" forall s. 
    stream (unstream s) = s 
- #-}
+ #-}

Data/Text/Utf8/Internal.hs

-module Text.Utf8.Internal where
+module Data.Text.Utf8.Internal where
     
 import Data.Array.Unboxed
 import Data.Word
 
-data Text = Text !(UArray Int Word8) !Int !Int
+data Text = Text !(UArray Int Word8) !Int !Int
-{-# OPTIONS_GHC -fglasgow-exts -fbang-patterns #-}
-
 --module Bench where
 
 import BenchUtils
 import System.Mem 
 import Control.Concurrent
-import Char 
+import Data.Char
 import Data.Array.IArray
 import System.CPUTime
 import System.IO
 import Text.Printf
 import Control.Exception
 
-import qualified Text as T
-import Text.Internal
-import qualified Text.Fusion as S
-import Text.Fusion (Encoding(..))
+import qualified Data.Text as T
+import Data.Text.Internal
+import qualified Data.Text.Fusion as S
+import Data.Text.Fusion (Encoding(..))
 
 import qualified Data.List as L
 import qualified Data.ByteString as B
                  ("take",
                   [F (app1 $ T.take 30000000),
                    Flist (app2 $ L.take 30000000)])
-                ]
+                ]

tests/BenchUtils.hs

-{-# OPTIONS_GHC -fglasgow-exts -fbang-patterns #-}
-
+{-# LANGUAGE ExistentialQuantification #-}
 module BenchUtils where
 
 import qualified Data.List as L
 import Data.Word
 import Text.Printf
 import System.IO
-import Text.Internal (Text(..))
+import Data.Text.Internal (Text(..))
 import System.Mem
 import System.CPUTime
 import Control.Exception

tests/EncodingBench.hs

-{-# OPTIONS_GHC -fglasgow-exts #-}
+{-# LANGUAGE ExistentialQuantification #-}
 
 import BenchUtils
 import qualified Data.Text.Utf8.Fusion as U8
      [F $ app1 $ S.foldl' (\a w -> a+1::Int) 0 . U8.stream,
       F $ app2 $ S.foldl' (\a w -> a+1::Int) 0 . S.stream,
       F $ app3 $ S.foldl' (\a w -> a+1::Int) 0 . U32.stream])
- ]
+ ]

tests/FusionBench.hs

 import Prelude hiding (zip,zip3,fst,snd)
 
 import BenchUtils
-import Char
+import Data.Char
 import qualified Data.List as L
 import qualified Data.ByteString as B
-import qualified Text as T
-import Text.Fusion (Encoding(..))
-import qualified Text.Fusion as S
+import qualified Data.Text as T
+import Data.Text.Fusion (Encoding(..))
+import qualified Data.Text.Fusion as S
 import Text.Printf
 import System.IO
 import System.Mem

tests/Properties.hs

-{-# OPTIONS_GHC -fno-rewrite-rules #-}
+{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
 
 import Test.QuickCheck
 import Text.Show.Functions
 
 import Prelude 
-import qualified Text as T
-import Text (pack,unpack)
-import qualified Text.Fusion as S
-import Text.Fusion (unstream,stream)
+import qualified Data.Text as T
+import Data.Text (pack,unpack)
+import qualified Data.Text.Fusion as S
+import Data.Text.Fusion (unstream,stream)
 import qualified Data.List as L
 
 

tests/QuickCheckUtils.hs

 import Test.QuickCheck
 import Test.QuickCheck.Batch
 
-import Char
+import Data.Char
 
-import Text
-import Text.Internal
+import Data.Text
+import Data.Text.Internal
 
 instance Arbitrary Char where
     arbitrary    = oneof [choose ('\0','\55295'), choose ('\57334','\1114111')]
 
 instance Arbitrary Text where
     arbitrary     = pack `fmap` arbitrary
-    coarbitrary s = coarbitrary (unpack s)
+    coarbitrary s = coarbitrary (unpack s)