escape_test.gno
0.77 Kb · 18 lines
1package piglatindemo
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// TestRenderEscapesSentence pins that the sentence and its translation are
14// escaped inside their blockquotes: v0 wrote both raw, so an image or a link
15// in the path rendered, and Translate keeps punctuation in place.
16func TestRenderEscapesSentence(t *testing.T) {
17 uassert.Equal(t, "# Pig Latin\n\n**Original:**\n\n> x\\` \\!\\[p\\]\\(https:e\\.io\\) \\`y\n\n**Pig Latin:**\n\n> xay\\` \\!\\[e\\.iop\\]\\(https:ay\\) \\`yay\n\n---\n\n[← rules & examples](/r/moul/x/daily/piglatindemo/v1)\n", Render("/"+payload))
18}