1package millipede
2
3import (
4 "testing"
5
6 "gno.land/p/demo/uassert"
7)
8
9func TestRender(t *testing.T) {
10 cases := []struct {
11 path string
12 expected string
13 }{
14 {
15 path: "",
16 expected: "```" + `
17 ╚⊙ ⊙╝
18 ╚═(███)═╝
19 ╚═(███)═╝
20╚═(███)═╝
21 ╚═(███)═╝
22 ╚═(███)═╝
23 ╚═(███)═╝
24 ╚═(███)═╝
25 ╚═(███)═╝
26 ╚═(███)═╝
27 ╚═(███)═╝
28 ╚═(███)═╝
29╚═(███)═╝
30 ╚═(███)═╝
31 ╚═(███)═╝
32 ╚═(███)═╝
33 ╚═(███)═╝
34 ╚═(███)═╝
35 ╚═(███)═╝
36 ╚═(███)═╝
37 ╚═(███)═╝
38` + "```\n[19](/r/demo/art/millipede:19)< >[21](/r/demo/art/millipede:21)",
39 },
40 {
41 path: "4",
42 expected: "```" + `
43 ╚⊙ ⊙╝
44 ╚═(███)═╝
45 ╚═(███)═╝
46╚═(███)═╝
47 ╚═(███)═╝
48` + "```\n[3](/r/demo/art/millipede:3)< >[5](/r/demo/art/millipede:5)",
49 },
50 }
51
52 for _, tc := range cases {
53 t.Run(tc.path, func(t *testing.T) {
54 got := Render(tc.path)
55 uassert.Equal(t, tc.expected, got)
56 })
57 }
58}
millipede_test.gno
1.18 Kb · 58 lines