escape_test.gno
0.71 Kb · 17 lines
1package luhndemo
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// TestRenderEscapesPath pins that the echoed input is a code span it cannot
14// close: v0 wrote it between two hand-placed backticks, before luhn.Valid.
15func TestRenderEscapesPath(t *testing.T) {
16 uassert.Equal(t, "# Luhn Checksum\n\nThe mod-10 check behind card numbers and IMEIs, demoing the [`p/moul/x/daily/luhn`](/p/moul/x/daily/luhn/v0) library.\n\n## ``x`  `y``\n\n**Not valid.**\n\nIt has no usable digits to check.\n", Render("/"+payload))
17}