Commit 83829403 authored by chak's avatar chak

[project @ 2002-11-07 07:18:13 by chak]

Started on regression tests for Template Haskell
parent 4e1cf1a6
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
-- test reification of declarations
module TH_reifyDecl1
where
import Language.Haskell.THSyntax
data T = A | B
decl_T :: Decl
decl_T = reifyDecl T
-- test reification of monomorphic types
module TH_reifyType1
where
import Language.Haskell.THSyntax
foo :: Int -> Int
foo x = x + 1
type_foo :: Type
type_foo = reifyType foo
-- test reification of polymorphic types
module TH_reifyType1
where
import Language.Haskell.THSyntax
type_length :: Type
type_length = reifyType length
-- test the representation of literals and also explicit type annotations
module TH_repE1
where
import Language.Haskell.THSyntax
intExpr :: Expr
intExpr = [| 42 :: Int |]
integerExpr :: Expr
integerExpr = [| 42 :: Integer |]
charExpr :: Expr
charExpr = [| 'x' |]
stringExpr :: Expr
stringExpr = [| "A String" |]
floatExpr :: Expr
floatExpr = [| 1.2 :: Float |]
doubleExpr :: Expr
doubleExpr = [| 1.2 :: Double |]
def f(opts):
opts.extra_hc_opts = '-fglasgow-exts -package haskell-src'
setTestOpts(f)
setTestOpts(only_ways(['normal']));
test('TH_repE1', normal, compile, [''])
test('TH_reifyDecl1', normal, compile, [''])
test('TH_reifyType1', normal, compile, [''])
test('TH_reifyType2', normal, compile, [''])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment