summaryrefslogtreecommitdiff
path: root/testsuite/tests/package
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-03-10 14:10:26 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-03-10 15:20:43 -0700
commit8cbd7f5d97cdc0f4cd6b8baaa999f990533dc801 (patch)
treec795fdea467ce91690f6090dbb1bbe01ba610ccd /testsuite/tests/package
parent8a91079b5895c1505717b5d401617269720ad8ab (diff)
downloadhaskell-8cbd7f5d97cdc0f4cd6b8baaa999f990533dc801.tar.gz
Refactor testsuite with normalise_version()
Summary: This function generalizes the normaliseBytestringPackage and other similar one-off functions into normalise_version() with takes a package name to normalize against. This JUST manages package versions; we also could use a normalize for keys. In the process, I modified all the normalization functions to be accumulative; I don't think this makes a difference for current test cases but I think it makes things nicer. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D725
Diffstat (limited to 'testsuite/tests/package')
-rw-r--r--testsuite/tests/package/all.T9
1 files changed, 3 insertions, 6 deletions
diff --git a/testsuite/tests/package/all.T b/testsuite/tests/package/all.T
index f2dc9dc6fa..1f5f46091e 100644
--- a/testsuite/tests/package/all.T
+++ b/testsuite/tests/package/all.T
@@ -7,9 +7,6 @@ incr_ghc = '-package "ghc (HsTypes as MyHsTypes, HsUtils)" '
inc_ghc = '-package ghc '
hide_ghc = '-hide-package ghc '
-def normaliseGhcVersion(str):
- return re.sub('ghc-[0-9.]+', 'ghc-<VERSION>', str)
-
test('package01', normal, compile, [hide_all + incr_containers])
test('package01e', normal, compile_fail, [hide_all + incr_containers])
test('package02', normal, compile, [hide_all + inc_containers + incr_containers])
@@ -17,8 +14,8 @@ test('package03', normal, compile, [hide_all + incr_containers + inc_conta
test('package04', normal, compile, [incr_containers])
test('package05', normal, compile, [incr_ghc + inc_ghc])
test('package06', normal, compile, [incr_ghc])
-test('package06e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc])
-test('package07e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc + inc_ghc + hide_ghc])
-test('package08e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc + hide_ghc])
+test('package06e', normalise_version('ghc'), compile_fail, [incr_ghc])
+test('package07e', normalise_version('ghc'), compile_fail, [incr_ghc + inc_ghc + hide_ghc])
+test('package08e', normalise_version('ghc'), compile_fail, [incr_ghc + hide_ghc])
test('package09e', normal, compile_fail, ['-package "containers (Data.Map as M, Data.Set as M)"'])
test('package10', normal, compile, ['-hide-all-packages -package "ghc (UniqFM as Prelude)" '])