add unnamed_class_table_code regression test

This commit is contained in:
Gavin Nishizawa 2022-12-28 14:29:13 -08:00
parent 17e4ae0e34
commit 6cb72cb417
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
5 changed files with 939 additions and 0 deletions

View file

@ -215,6 +215,39 @@ m6_desc: |md
inserted here
|
m6_desc -> queue.M6
`,
},
{
name: "unnamed_class_table_code",
script: `
class -> users -> code
class: "" {
shape: class
-num: int
-timeout: int
-pid
+getStatus(): Enum
+getJobs(): "Job[]"
+setTimeout(seconds int)
}
users: "" {
shape: sql_table
id: int
name: string
email: string
password: string
last_login: datetime
}
code: |go
a := 5
b := a + 7
fmt.Printf("%d", b)
|
`,
},
}

View file

@ -0,0 +1,400 @@
{
"name": "",
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "class",
"type": "class",
"pos": {
"x": 48,
"y": 0
},
"width": 100,
"height": 100,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#0A0F25",
"stroke": "#FFFFFF",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": [
{
"name": "num",
"type": "int",
"visibility": "private"
},
{
"name": "timeout",
"type": "int",
"visibility": "private"
},
{
"name": "pid",
"type": "",
"visibility": "private"
}
],
"methods": [
{
"name": "getStatus()",
"return": "Enum",
"visibility": "public"
},
{
"name": "getJobs()",
"return": "Job[]",
"visibility": "public"
},
{
"name": "setTimeout(seconds int)",
"return": "void",
"visibility": "public"
}
],
"columns": null,
"label": "",
"fontSize": 20,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 1,
"primaryAccentColor": "#0D32B2",
"secondaryAccentColor": "#4A6FF3",
"neutralAccentColor": "#676C7E"
},
{
"id": "users",
"type": "sql_table",
"pos": {
"x": 48,
"y": 200
},
"width": 100,
"height": 100,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#0A0F25",
"stroke": "#FFFFFF",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": [
{
"name": {
"label": "id",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "int",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "name",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "email",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "password",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "last_login",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "datetime",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
}
],
"label": "",
"fontSize": 20,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 1,
"primaryAccentColor": "#0D32B2",
"secondaryAccentColor": "#4A6FF3",
"neutralAccentColor": "#676C7E"
},
{
"id": "code",
"type": "code",
"pos": {
"x": 0,
"y": 400
},
"width": 196,
"height": 70,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#FFFFFF",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "golang",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 196,
"labelHeight": 70,
"zIndex": 0,
"level": 1
}
],
"connections": [
{
"id": "(class -> users)[0]",
"src": "class",
"srcArrow": "none",
"srcLabel": "",
"dst": "users",
"dstArrow": "triangle",
"dstLabel": "",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "#0D32B2",
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#676C7E",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 98,
"y": 100
},
{
"x": 98,
"y": 140
},
{
"x": 98,
"y": 160
},
{
"x": 98,
"y": 200
}
],
"isCurve": true,
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
},
{
"id": "(users -> code)[0]",
"src": "users",
"srcArrow": "none",
"srcLabel": "",
"dst": "code",
"dstArrow": "triangle",
"dstLabel": "",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "#0D32B2",
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#676C7E",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 98,
"y": 300
},
{
"x": 98,
"y": 340
},
{
"x": 98,
"y": 360
},
{
"x": 98,
"y": 400
}
],
"isCurve": true,
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
}
]
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 512 KiB

View file

@ -0,0 +1,382 @@
{
"name": "",
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "class",
"type": "class",
"pos": {
"x": 60,
"y": 12
},
"width": 100,
"height": 100,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#0A0F25",
"stroke": "#FFFFFF",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": [
{
"name": "num",
"type": "int",
"visibility": "private"
},
{
"name": "timeout",
"type": "int",
"visibility": "private"
},
{
"name": "pid",
"type": "",
"visibility": "private"
}
],
"methods": [
{
"name": "getStatus()",
"return": "Enum",
"visibility": "public"
},
{
"name": "getJobs()",
"return": "Job[]",
"visibility": "public"
},
{
"name": "setTimeout(seconds int)",
"return": "void",
"visibility": "public"
}
],
"columns": null,
"label": "",
"fontSize": 20,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 1,
"primaryAccentColor": "#0D32B2",
"secondaryAccentColor": "#4A6FF3",
"neutralAccentColor": "#676C7E"
},
{
"id": "users",
"type": "sql_table",
"pos": {
"x": 60,
"y": 212
},
"width": 100,
"height": 100,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#0A0F25",
"stroke": "#FFFFFF",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": [
{
"name": {
"label": "id",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "int",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "name",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "email",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "password",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "string",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
},
{
"name": {
"label": "last_login",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"type": {
"label": "datetime",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0
},
"constraint": "",
"reference": ""
}
],
"label": "",
"fontSize": 20,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 1,
"primaryAccentColor": "#0D32B2",
"secondaryAccentColor": "#4A6FF3",
"neutralAccentColor": "#676C7E"
},
{
"id": "code",
"type": "code",
"pos": {
"x": 12,
"y": 412
},
"width": 196,
"height": 70,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#FFFFFF",
"stroke": "#0A0F25",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a := 5\nb := a + 7\nfmt.Printf(\"%d\", b)",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "golang",
"color": "#0A0F25",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 196,
"labelHeight": 70,
"zIndex": 0,
"level": 1
}
],
"connections": [
{
"id": "(class -> users)[0]",
"src": "class",
"srcArrow": "none",
"srcLabel": "",
"dst": "users",
"dstArrow": "triangle",
"dstLabel": "",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "#0D32B2",
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#676C7E",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 110,
"y": 112
},
{
"x": 110,
"y": 212
}
],
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
},
{
"id": "(users -> code)[0]",
"src": "users",
"srcArrow": "none",
"srcLabel": "",
"dst": "code",
"dstArrow": "triangle",
"dstLabel": "",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "#0D32B2",
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#676C7E",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 110,
"y": 312
},
{
"x": 110,
"y": 412
}
],
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
}
]
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 512 KiB