[commit: ghc] master: Modify test th/T10019 to wobble less (76f385b)
git at git.haskell.org
git at git.haskell.org
Fri Mar 20 10:23:13 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/76f385ba840fdb87ff4254cd838752ba161b0a8d/ghc
>---------------------------------------------------------------
commit 76f385ba840fdb87ff4254cd838752ba161b0a8d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Mar 19 23:17:21 2015 +0000
Modify test th/T10019 to wobble less
The TH output contains uniques which change too much.
So I took the length of the string instead. Crude,
perhaps too crude, but it'll still show up most significant
output changes
>---------------------------------------------------------------
76f385ba840fdb87ff4254cd838752ba161b0a8d
testsuite/tests/th/T10019.script | 9 ++++++++-
testsuite/tests/th/T10019.stdout | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/testsuite/tests/th/T10019.script b/testsuite/tests/th/T10019.script
index eef5fe7..97ecbe1 100644
--- a/testsuite/tests/th/T10019.script
+++ b/testsuite/tests/th/T10019.script
@@ -1,4 +1,11 @@
:set -XTemplateHaskell
import Language.Haskell.TH
data Option a = Some a | None
-$(reify 'Some >>= stringE . show)
+$(reify 'Some >>= litE . integerL . toInteger . length . show)
+-- By taking the length we avoid wobbling when the exact uniques
+-- chosen by TH change
+--
+-- This was the original
+-- $(reify 'Some >>= stringE . show)
+-- which yields
+-- "DataConI Ghci1.Some (ForallT [KindedTV a_1627391549 StarT] [] (AppT (AppT ArrowT (VarT a_1627391549)) (AppT (ConT Ghci1.Option) (VarT a_1627391549)))) Ghci1.Option (Fixity 9 InfixL)"
\ No newline at end of file
diff --git a/testsuite/tests/th/T10019.stdout b/testsuite/tests/th/T10019.stdout
index 350338c..d65e8e3 100644
--- a/testsuite/tests/th/T10019.stdout
+++ b/testsuite/tests/th/T10019.stdout
@@ -1 +1 @@
-"DataConI Ghci1.Some (ForallT [KindedTV a_1627391549 StarT] [] (AppT (AppT ArrowT (VarT a_1627391549)) (AppT (ConT Ghci1.Option) (VarT a_1627391549)))) Ghci1.Option (Fixity 9 InfixL)"
+181
More information about the ghc-commits
mailing list