millipede_test.gno

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