Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

zz_escape_test.gno

0.60 Kb · 18 lines
 1package polls
 2
 3import (
 4	"strings"
 5	"testing"
 6
 7	"gno.land/p/nt/testutils/v0"
 8	"gno.land/p/nt/uassert/v0"
 9)
10
11// A question and its options are the creator's text: escaped.
12func TestQuestionAndOptionsAreEscaped(cur realm, t *testing.T) {
13	testing.SetRealm(testing.NewUserRealm(testutils.TestAddress("escaper")))
14	id := CreatePoll(cross(cur), "[claim](https://evil.example)", "[claim](https://evil.example)"+",no")
15	page := Render(itoaTest(id))
16	uassert.False(t, strings.Contains(page, "[claim](https://evil.example)"), page)
17	uassert.False(t, strings.Contains(Render(""), "[claim](https://evil.example)"), Render(""))
18}