Revision 147fd319 test/hs/Test/Ganeti/TestHelper.hs
b/test/hs/Test/Ganeti/TestHelper.hs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
{- |
8 | 8 |
|
9 |
Copyright (C) 2011, 2012 Google Inc. |
|
9 |
Copyright (C) 2011, 2012, 2013 Google Inc.
|
|
10 | 10 |
|
11 | 11 |
This program is free software; you can redistribute it and/or modify |
12 | 12 |
it under the terms of the GNU General Public License as published by |
... | ... | |
48 | 48 |
casePrefix :: String |
49 | 49 |
casePrefix = "case_" |
50 | 50 |
|
51 |
-- | Test case prefix without underscore. |
|
52 |
case2Pfx :: String |
|
53 |
case2Pfx = "case" |
|
54 |
|
|
51 | 55 |
-- | Tries to drop a prefix from a string. |
52 | 56 |
simplifyName :: String -> String -> String |
53 | 57 |
simplifyName pfx string = fromMaybe string (stripPrefix pfx string) |
... | ... | |
70 | 74 |
in case () of |
71 | 75 |
_ | propPrefix `isPrefixOf` str -> [| runProp $strE $nameE |] |
72 | 76 |
| casePrefix `isPrefixOf` str -> [| runCase $strE $nameE |] |
77 |
| case2Pfx `isPrefixOf` str -> |
|
78 |
[| (testCase . simplifyName case2Pfx) $strE $nameE |] |
|
73 | 79 |
| otherwise -> fail $ "Unsupported test function name '" ++ str ++ "'" |
74 | 80 |
|
75 | 81 |
-- | Convert slashes in a name to underscores. |
Also available in: Unified diff