Verified Commit c243a740 authored by Camil Staps's avatar Camil Staps 🙂

Add support for "without default imports" in @property-bootstrap

parent cda8a53e
......@@ -322,13 +322,15 @@ where
coverage = toReal (length (filter (not o isEmpty) propsets)) / toReal (length fes + length ies)
tests = join "\n\n"
[ "module " +++ testmodname
, join "\n"
[ "import Gast, Gast.CommandLine"
, "from Testing.TestEvents import :: TestLocation{..}"
, "from StdString import instance toString {#Char}"
, "import Control.GenBimap"
, "import " +++ modname
]
, join "\n" $
if default_imports
[ "import Gast, Gast.CommandLine"
, "from Testing.TestEvents import :: TestLocation{..}"
, "from StdString import instance toString {#Char}"
, "import Control.GenBimap"
, "import " +++ modname
]
[]
, bootstrap
, generators_string
, invariants
......@@ -343,7 +345,13 @@ where
pvis = fromMaybe [] $ docPropertyTestWith <$> mod_doc
props = flatten propsets
bootstrap = fromMaybe "" (docPropertyBootstrap =<< mod_doc)
(bootstrap,default_imports) = case docPropertyBootstrap =<< mod_doc of
Nothing ->
("",True)
Just bs=:{bootstrap_content=MultiLine content} ->
( content
, not bs.bootstrap_without_default_imports
)
invariants = join "\n\n" $ concatMap (\(_,td) -> map invariant td.TypeDoc.invariants) tes
where
......
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