hydra.haskell.testing module

Haskell test code generation for HSpec-based generation tests.

hydra.haskell.testing.add_namespaces_to_namespaces(ns0: ModuleNames[ModuleName], names: Set[Name]) ModuleNames[ModuleName]

Add namespaces from a set of names to existing namespaces.

hydra.haskell.testing.build_namespaces_for_test_group(mod: Module, tgroup: TestGroup, graph_: Graph) object

Build namespaces for a test group including encoded term references.

hydra.haskell.testing.build_test_module(test_module: Module, test_group: TestGroup, test_body: str, namespaces: ModuleNames[ModuleName]) str

Build the complete test module for Haskell HSpec.

hydra.haskell.testing.collect_names(graf: Graph, names: Set[Name], t: Term) Set[Name]

Collect variable names from encoded terms within a single term node.

hydra.haskell.testing.collect_test_cases(tg: TestGroup) Sequence[TestCaseWithMetadata]

Collect all test cases from a test group recursively.

hydra.haskell.testing.extract_encoded_term_variable_names(graf: Graph, term: Term) Set[Name]

Extract all variable names from term-encoded terms in a given term.

hydra.haskell.testing.extract_test_terms(tcm: T0) Sequence[T1]

Extract input and output terms from a test case.

hydra.haskell.testing.find_haskell_imports(namespaces: ModuleNames[ModuleName], names_: T0) Sequence[str]

Find necessary imports for Haskell based on referenced names.

hydra.haskell.testing.generate_haskell_test_file(test_module: Module, test_group: TestGroup, g: Graph) object

Generate a Haskell test file for a test group, with type inference and namespace building.

hydra.haskell.testing.generate_test_case(depth: T0, tcm: TestCaseWithMetadata) object

Generate a single HSpec test case from a universal test case.

hydra.haskell.testing.generate_test_file(test_module: Module, test_group: TestGroup, namespaces: ModuleNames[ModuleName]) object

Generate a complete Haskell test file.

hydra.haskell.testing.generate_test_group_hierarchy(depth: int, test_group: TestGroup) object

Generate test hierarchy preserving the structure with H.describe blocks for subgroups.

hydra.haskell.testing.namespace_to_module_name(ns_: ModuleName) str

Convert namespace to Haskell module name.