diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-15 08:17:32 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-15 08:17:32 +0100 |
commit | b86d227cbc2f19a262ebfdd35a300a4ea0911a5a (patch) | |
tree | 78eb5353fb78ab844eb264b32d97190d7c4175ba /testsuite/tests/th | |
parent | 3d6d96742c4626ab525c1c8a1784acbce619d152 (diff) | |
download | haskell-b86d227cbc2f19a262ebfdd35a300a4ea0911a5a.tar.gz |
Tests for Trac #5404 and #5410
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T5404.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/th/T5410.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/th/T5410.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 2 |
4 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/th/T5404.hs b/testsuite/tests/th/T5404.hs new file mode 100644 index 0000000000..18f21d6914 --- /dev/null +++ b/testsuite/tests/th/T5404.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE TemplateHaskell #-}
+
+module T5404 where
+
+foobar :: Int
+foobar = $([|
+ let
+ bar :: Int
+ bar = 5
+ in bar
+ |])
+
diff --git a/testsuite/tests/th/T5410.hs b/testsuite/tests/th/T5410.hs new file mode 100644 index 0000000000..da9e51aa7f --- /dev/null +++ b/testsuite/tests/th/T5410.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-}
+module Main where
+
+$([d| instance Show (a -> b) where
+ showsPrec _ _ = showString "<function>"
+ |])
+
+main = print id
\ No newline at end of file diff --git a/testsuite/tests/th/T5410.stdout b/testsuite/tests/th/T5410.stdout new file mode 100644 index 0000000000..cc9bc03d31 --- /dev/null +++ b/testsuite/tests/th/T5410.stdout @@ -0,0 +1 @@ +<function>
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index f69a9ab9dd..a1c4fbb6af 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -196,3 +196,5 @@ test('TH_unresolvedInfix2', test('T5358', normal, compile_fail, ['']) test('T5379', normal, compile_and_run, ['']) +test('T5404', normal, compile, ['-v0']) +test('T5410', normal, compile_and_run, ['-v0']) |