From 57bec968ef305534145645d607d5779cf5c46c7a Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Mon, 3 Apr 2023 01:23:53 +0200 Subject: [PATCH] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../gno.land/r/demo/art/gnoface/gnoface.gno | 6 ++-- .../r/demo/art/gnoface/gnoface_test.gno | 33 ++++++++++--------- .../r/demo/art/millipede/millipede.gno | 4 +-- .../r/demo/art/millipede/millipede_test.gno | 8 ++--- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/examples/gno.land/r/demo/art/gnoface/gnoface.gno b/examples/gno.land/r/demo/art/gnoface/gnoface.gno index 6354199de2b..3ddc730008e 100644 --- a/examples/gno.land/r/demo/art/gnoface/gnoface.gno +++ b/examples/gno.land/r/demo/art/gnoface/gnoface.gno @@ -104,7 +104,8 @@ func Draw(seed int64) string { r := rand.FromSeed(seed) - output := pick(r, hairs) + "\n" + + return "```\n" + + pick(r, hairs) + "\n" + pick(r, headtop) + "\n" + pick(r, headspace) + "\n" + " | " + pick(r, eyebrow) + " " + pick(r, eyebrow) + " |\n" + @@ -114,8 +115,7 @@ func Draw(seed int64) string { pick(r, headspace) + "\n" + pick(r, mouth) + "\n" + pick(r, headspace) + "\n" + - pick(r, headbottom) - return output + pick(r, headbottom) + "\n```\n" } func pick(r *rand.Instance, slice []string) string { diff --git a/examples/gno.land/r/demo/art/gnoface/gnoface_test.gno b/examples/gno.land/r/demo/art/gnoface/gnoface_test.gno index 0a3fc3e34e5..5c621721e05 100644 --- a/examples/gno.land/r/demo/art/gnoface/gnoface_test.gno +++ b/examples/gno.land/r/demo/art/gnoface/gnoface_test.gno @@ -13,7 +13,7 @@ func TestGnoface(t *testing.T) { }{ { seed: 42, - expected: ` + expected: "```" + ` ||||||| ////////\ | | @@ -24,11 +24,12 @@ func TestGnoface(t *testing.T) { | | | __/ | | | - \~~~~~~~/`[1:], + \~~~~~~~/ +` + "```\n", }, { seed: 1337, - expected: ` + expected: "```" + ` s /|||||||\ | | @@ -39,11 +40,12 @@ o| ~ ~ |. | | | __/ | | | - \_______/`[1:], + \_______/ +` + "```\n", }, { seed: 123456789, - expected: ` + expected: "```" + ` s /~~~~~~~\ | | @@ -54,7 +56,8 @@ o| ~ ~ |. | | | \_/ | | | - \-------/`[1:], + \-------/ +` + "```\n", }, } for _, tc := range cases { @@ -75,8 +78,7 @@ func TestRender(t *testing.T) { }{ { path: "42", - expected: ` -Gnoface #42 + expected: "Gnoface #42\n```" + ` ||||||| ////////\ | | @@ -87,12 +89,12 @@ Gnoface #42 | | | __/ | | | - \~~~~~~~/`[1:], + \~~~~~~~/ +` + "```\n", }, { path: "1337", - expected: ` -Gnoface #1337 + expected: "Gnoface #1337\n```" + ` s /|||||||\ | | @@ -103,12 +105,12 @@ o| ~ ~ |. | | | __/ | | | - \_______/`[1:], + \_______/ +` + "```\n", }, { path: "123456789", - expected: ` -Gnoface #123456789 + expected: "Gnoface #123456789\n```" + ` s /~~~~~~~\ | | @@ -119,7 +121,8 @@ Gnoface #123456789 | | | \_/ | | | - \-------/`[1:], + \-------/ +` + "```\n", }, } for _, tc := range cases { diff --git a/examples/gno.land/r/demo/art/millipede/millipede.gno b/examples/gno.land/r/demo/art/millipede/millipede.gno index df5b66119aa..dbffd8b3fbb 100644 --- a/examples/gno.land/r/demo/art/millipede/millipede.gno +++ b/examples/gno.land/r/demo/art/millipede/millipede.gno @@ -13,7 +13,7 @@ const ( maxSize = 100 ) -func Millipede(size int) string { +func Draw(size int) string { if size < minSize || size > maxSize { panic("invalid millipede size") } @@ -38,7 +38,7 @@ func Render(path string) string { } } - output := Millipede(size) + output := "```\n" + Draw(size) + "```\n" if size > minSize { output += ufmt.Sprintf("[%d](/r/art/millpede:%d)< ", size-1, size-1) } diff --git a/examples/gno.land/r/demo/art/millipede/millipede_test.gno b/examples/gno.land/r/demo/art/millipede/millipede_test.gno index fab8f69632c..38914707b4a 100644 --- a/examples/gno.land/r/demo/art/millipede/millipede_test.gno +++ b/examples/gno.land/r/demo/art/millipede/millipede_test.gno @@ -12,7 +12,7 @@ func TestRender(t *testing.T) { }{ { path: "", - expected: ` + expected: "```" + ` ╚⊙ ⊙╝ ╚═(███)═╝ ╚═(███)═╝ @@ -34,17 +34,17 @@ func TestRender(t *testing.T) { ╚═(███)═╝ ╚═(███)═╝ ╚═(███)═╝ -[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)`[1:], +` + "```\n[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)", }, { path: "4", - expected: ` + expected: "```" + ` ╚⊙ ⊙╝ ╚═(███)═╝ ╚═(███)═╝ ╚═(███)═╝ ╚═(███)═╝ -[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)`[1:], +` + "```\n[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)", }, }