move tests to stable from todo

This commit is contained in:
Gavin Nishizawa 2022-11-07 19:35:06 -08:00
parent d89a564bb1
commit ed8c8ea157
8 changed files with 71 additions and 65 deletions

View file

@ -638,6 +638,41 @@ func RegisterHash(h Hash, f func() hash.Hash) {
| |
x -> hey -> y`, x -> hey -> y`,
}, },
{
name: "md_code_inline",
script: `md: |md
` + "`code`" + `
|
a -> md -> b
`,
},
{
name: "md_code_block_fenced",
script: `md: |md
` + "```" + `
{
fenced: "block",
of: "json",
}
` + "```" + `
|
a -> md -> b
`,
},
{
name: "md_code_block_indented",
script: `md: |md
a line of text and an
{
indented: "block",
of: "json",
}
|
a -> md -> b
`,
},
} }
runa(t, tcs) runa(t, tcs)

View file

Before

Width:  |  Height:  |  Size: 841 KiB

After

Width:  |  Height:  |  Size: 841 KiB

View file

@ -8,8 +8,8 @@
"x": 0, "x": 0,
"y": 226 "y": 226
}, },
"width": 208, "width": 212,
"height": 24, "height": 151,
"level": 1, "level": 1,
"opacity": 1, "opacity": 1,
"strokeDash": 0, "strokeDash": 0,
@ -27,7 +27,7 @@
"fields": null, "fields": null,
"methods": null, "methods": null,
"columns": null, "columns": null,
"label": "{\n indented: \"block\",\n of: \"json\",\n}", "label": "a line of text and an\n\n\t{\n\t\tindented: \"block\",\n\t\tof: \"json\",\n\t}\n",
"fontSize": 16, "fontSize": 16,
"fontFamily": "DEFAULT", "fontFamily": "DEFAULT",
"language": "markdown", "language": "markdown",
@ -35,14 +35,14 @@
"italic": false, "italic": false,
"bold": true, "bold": true,
"underline": false, "underline": false,
"labelWidth": 208, "labelWidth": 212,
"labelHeight": 24 "labelHeight": 151
}, },
{ {
"id": "a", "id": "a",
"type": "", "type": "",
"pos": { "pos": {
"x": 48, "x": 50,
"y": 0 "y": 0
}, },
"width": 113, "width": 113,
@ -80,8 +80,8 @@
"id": "b", "id": "b",
"type": "", "type": "",
"pos": { "pos": {
"x": 48, "x": 50,
"y": 350 "y": 477
}, },
"width": 113, "width": 113,
"height": 126, "height": 126,
@ -142,19 +142,19 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": 104, "x": 106,
"y": 126 "y": 126
}, },
{ {
"x": 104, "x": 106,
"y": 166 "y": 166
}, },
{ {
"x": 104, "x": 106,
"y": 186 "y": 186
}, },
{ {
"x": 104, "x": 106,
"y": 226 "y": 226
} }
], ],
@ -189,20 +189,20 @@
"labelPercentage": 0, "labelPercentage": 0,
"route": [ "route": [
{ {
"x": 104, "x": 106,
"y": 250 "y": 377
}, },
{ {
"x": 104, "x": 106,
"y": 290 "y": 417
}, },
{ {
"x": 104, "x": 106,
"y": 310 "y": 437
}, },
{ {
"x": 104, "x": 106,
"y": 350 "y": 477
} }
], ],
"isCurve": true, "isCurve": true,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 660 KiB

After

Width:  |  Height:  |  Size: 841 KiB

View file

Before

Width:  |  Height:  |  Size: 841 KiB

After

Width:  |  Height:  |  Size: 841 KiB

View file

@ -6,45 +6,7 @@ import (
) )
func testTodo(t *testing.T) { func testTodo(t *testing.T) {
tcs := []testCase{ tcs := []testCase{}
// https://github.com/terrastruct/d2/issues/24
// string monstrosity from not being able to escape backticks within string literals
{
name: "md_code_inline",
script: `md: |md
` + "`code`" + `
|
a -> md -> b
`,
},
{
name: "md_code_block_fenced",
script: `md: |md
` + "```" + `
{
fenced: "block",
of: "json",
}
` + "```" + `
|
a -> md -> b
`,
},
{
name: "md_code_block_indented",
script: `md: |md
a line of text and an
{
indented: "block",
of: "json",
}
|
a -> md -> b
`,
},
}
runa(t, tcs) runa(t, tcs)
} }