From 812202fe577120e0ead4c0453049853e4fb26243 Mon Sep 17 00:00:00 2001 From: Eric Myhre Date: Mon, 7 Sep 2020 00:33:52 +0200 Subject: [PATCH] Align several more bits of schema-schema json with the drifts made by the programatic type construction. The gap between these isn't within the reach of this test to probe. (Yet. We'll get there. It's not terribly much further.) --- .../go/_demo/omg-schemas/schema/parse_test.go | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/schema/gen/go/_demo/omg-schemas/schema/parse_test.go b/schema/gen/go/_demo/omg-schemas/schema/parse_test.go index 3a7e2694..b9fb3063 100644 --- a/schema/gen/go/_demo/omg-schemas/schema/parse_test.go +++ b/schema/gen/go/_demo/omg-schemas/schema/parse_test.go @@ -40,7 +40,7 @@ func TestSchemaSchemaParse(t *testing.T) { "SchemaMap": { "map": { "keyType": "TypeName", - "valueType": "Type" + "valueType": "TypeDefn" } }, "AdvancedDataLayoutName": { @@ -67,25 +67,22 @@ func TestSchemaSchemaParse(t *testing.T) { } } }, - "Type": { + "TypeDefn": { "union": { "representation": { - "inline": { - "discriminantKey": "kind", - "discriminantTable": { - "bool": "TypeBool", - "string": "TypeString", - "bytes": "TypeBytes", - "int": "TypeInt", - "float": "TypeFloat", - "map": "TypeMap", - "list": "TypeList", - "link": "TypeLink", - "union": "TypeUnion", - "struct": "TypeStruct", - "enum": "TypeEnum", - "copy": "TypeCopy" - } + "keyed": { + "bool": "TypeBool", + "string": "TypeString", + "bytes": "TypeBytes", + "int": "TypeInt", + "float": "TypeFloat", + "map": "TypeMap", + "list": "TypeList", + "link": "TypeLink", + "union": "TypeUnion", + "struct": "TypeStruct", + "enum": "TypeEnum", + "copy": "TypeCopy" } } } @@ -217,7 +214,7 @@ func TestSchemaSchemaParse(t *testing.T) { "type": "TypeName" }, "valueType": { - "type": "TypeTerm" + "type": "TypeNameOrInlineDefn" }, "valueNullable": { "type": "Bool" @@ -284,7 +281,7 @@ func TestSchemaSchemaParse(t *testing.T) { "struct": { "fields": { "valueType": { - "type": "TypeTerm" + "type": "TypeNameOrInlineDefn" }, "valueNullable": { "type": "Bool" @@ -464,7 +461,7 @@ func TestSchemaSchemaParse(t *testing.T) { "struct": { "fields": { "type": { - "type": "TypeTerm" + "type": "TypeNameOrInlineDefn" }, "optional": { "type": "Bool" @@ -487,25 +484,22 @@ func TestSchemaSchemaParse(t *testing.T) { } } }, - "TypeTerm": { + "TypeNameOrInlineDefn": { "union": { "representation": { "kinded": { "string": "TypeName", - "map": "InlineDefn" + "map": "TypeDefnInline" } } } }, - "InlineDefn": { + "TypeDefnInline": { "union": { "representation": { - "inline": { - "discriminantKey": "kind", - "discriminantTable": { - "map": "TypeMap", - "list": "TypeList" - } + "keyed": { + "map": "TypeMap", + "list": "TypeList" } } } @@ -625,7 +619,7 @@ func TestSchemaSchemaParse(t *testing.T) { "type": { "map": { "keyType": "EnumValue", - "valueType": "Null" + "valueType": "Unit" } } },