escape_test.gno
0.55 Kb · 17 lines
1package render
2
3import (
4 "testing"
5
6 "gno.land/p/nt/uassert/v0"
7)
8
9// payload closes a one-backtick code span and opens an image. Written raw, as
10// v0 does, it renders as markup the realm appears to have authored.
11const payload = "x`  `y"
12
13// TestRenderEscapesGreeting pins that the name in greetings/<name> is escaped:
14// v0 returned "Welcome, X`  `y!" with a live image in it.
15func TestRenderEscapesGreeting(t *testing.T) {
16 uassert.Equal(t, "Welcome, X\\` \\!\\[P\\]\\(Https:E\\.Io\\) \\`Y!", Render("greetings/"+payload))
17}