hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/test/utils.json
{
"name": "hydra.core.test.utils",
"metadata": {
"description": "Shared utility functions for test code generation codecs",
"comments": [],
"seeAlso": [],
"provisions": []},
"dependencies": [
{"module": "hydra.core.inference"},
{"module": "hydra.core.lexical"},
{"module": "hydra.core.lib.eithers"},
{"module": "hydra.core.print.errors"},
{"module": "hydra.core.testing"},
{"module": "hydra.core.typing"}],
"definitions": [
{
"term": {
"name": "hydra.core.test.utils.inferTerm",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Term"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "g",
"domain": {"variable": "hydra.core.graph.Graph"},
"body": {
"lambda": {
"parameter": "term",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bimap"}, "type": {"variable": "hydra.core.errors.Error"}}},
"type": {"variable": "hydra.core.typing.InferenceResult"}}},
"type": {"literal": "string"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.errors.Error"},
"body": {"application": {"function": {"variable": "hydra.core.print.errors.error"}, "argument": {"variable": "e"}}}}}}},
"argument": {
"lambda": {
"parameter": "x",
"domain": {"variable": "hydra.core.typing.InferenceResult"},
"body": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "term"}},
"argument": {"variable": "x"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.inference.inferInGraphContext"},
"argument": {"variable": "hydra.core.lexical.emptyInferenceContext"}}},
"argument": {"variable": "g"}}},
"argument": {"variable": "term"}}}}}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Run type inference on a single term"}}}]}}}}},
{
"term": {
"name": "hydra.core.test.utils.inferTestCase",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
"parameters": [
{"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.testing.TestCaseWithMetadata"}, "isLazy": false}],
"result": {"type": {"either": {"left": {"variable": "t1"}, "right": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "g",
"domain": {"variable": "t0"},
"body": {
"lambda": {
"parameter": "tcm",
"domain": {"variable": "hydra.core.testing.TestCaseWithMetadata"},
"body": {
"let": {
"bindings": [
{
"name": "name_",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestCaseWithMetadata", "fieldName": "name"}},
"argument": {"variable": "tcm"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}},
{
"name": "tcase",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestCaseWithMetadata", "fieldName": "case"}},
"argument": {"variable": "tcm"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.testing.TestCase"}, "constraints": []}},
{
"name": "desc",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestCaseWithMetadata", "fieldName": "description"}},
"argument": {"variable": "tcm"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}},
{
"name": "tags_",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestCaseWithMetadata", "fieldName": "tags"}},
"argument": {"variable": "tcm"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.testing.Tag"}}, "constraints": []}},
{
"name": "provisions_",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestCaseWithMetadata", "fieldName": "provisions"}},
"argument": {"variable": "tcm"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.testing.TestCase"}}},
"type": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}},
"type": {"variable": "t1"}}},
"argument": {
"lambda": {
"parameter": "inferredCase",
"domain": {"variable": "hydra.core.testing.TestCase"},
"body": {
"record": {
"typeName": "hydra.core.testing.TestCaseWithMetadata",
"fields": [
{"name": "name", "term": {"variable": "name_"}},
{"name": "case", "term": {"variable": "inferredCase"}},
{"name": "description", "term": {"variable": "desc"}},
{"name": "tags", "term": {"variable": "tags_"}},
{"name": "provisions", "term": {"variable": "provisions_"}}]}}}}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"either": {"right": {"variable": "tcase"}}}, "type": {"variable": "t1"}}},
"type": {"variable": "hydra.core.testing.TestCase"}}}}}}}}}}},
"annotation": {
"map": [
{"key": {"variable": "description"}, "value": {"literal": {"string": "Run type inference on the terms in a test case"}}}]}}}}}}}}},
{
"term": {
"name": "hydra.core.test.utils.inferTestGroupTerms",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
"parameters": [
{"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.testing.TestGroup"}, "isLazy": false}],
"result": {"type": {"either": {"left": {"variable": "t1"}, "right": {"variable": "hydra.core.testing.TestGroup"}}}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "g",
"domain": {"variable": "t0"},
"body": {
"lambda": {
"parameter": "tg",
"domain": {"variable": "hydra.core.testing.TestGroup"},
"body": {
"let": {
"bindings": [
{
"name": "name_",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestGroup", "fieldName": "name"}},
"argument": {"variable": "tg"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}},
{
"name": "desc",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestGroup", "fieldName": "description"}},
"argument": {"variable": "tg"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}},
{
"name": "subgroups",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestGroup", "fieldName": "subgroups"}},
"argument": {"variable": "tg"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.testing.TestGroup"}}, "constraints": []}},
{
"name": "cases_",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.testing.TestGroup", "fieldName": "cases"}},
"argument": {"variable": "tg"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "t1"}}},
"type": {"list": {"variable": "hydra.core.testing.TestGroup"}}}},
"type": {"variable": "hydra.core.testing.TestGroup"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.testing.TestGroup"}}},
"type": {"variable": "hydra.core.testing.TestGroup"}}},
"type": {"variable": "t1"}}},
"argument": {
"lambda": {
"parameter": "sg",
"domain": {"variable": "hydra.core.testing.TestGroup"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.test.utils.inferTestGroupTerms"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "g"}}},
"argument": {"variable": "sg"}}}}}}},
"argument": {"variable": "subgroups"}}}}},
"argument": {
"lambda": {
"parameter": "inferredSubgroups",
"domain": {"list": {"variable": "hydra.core.testing.TestGroup"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.eithers.map"},
"type": {"list": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}}},
"type": {"variable": "hydra.core.testing.TestGroup"}}},
"type": {"variable": "t1"}}},
"argument": {
"lambda": {
"parameter": "inferredCases",
"domain": {"list": {"variable": "hydra.core.testing.TestCaseWithMetadata"}},
"body": {
"record": {
"typeName": "hydra.core.testing.TestGroup",
"fields": [
{"name": "name", "term": {"variable": "name_"}},
{"name": "description", "term": {"variable": "desc"}},
{"name": "subgroups", "term": {"variable": "inferredSubgroups"}},
{"name": "cases", "term": {"variable": "inferredCases"}}]}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.eithers.mapList"},
"type": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}},
"type": {"variable": "hydra.core.testing.TestCaseWithMetadata"}}},
"type": {"variable": "t1"}}},
"argument": {
"lambda": {
"parameter": "tc",
"domain": {"variable": "hydra.core.testing.TestCaseWithMetadata"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.test.utils.inferTestCase"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "g"}}},
"argument": {"variable": "tc"}}}}}}},
"argument": {"variable": "cases_"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Run type inference on all terms in a TestGroup to ensure lambdas have domain types"}}}]}}}}}}}}}]}