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_links_test.gno

0.64 Kb · 20 lines
 1package handles
 2
 3import (
 4	"strings"
 5	"testing"
 6
 7	"gno.land/p/nt/testutils/v0"
 8	"gno.land/p/nt/uassert/v0"
 9)
10
11// The index links each handle to this realm's own page, and a missing
12// handle links back to the index. Both once resolved to gno.land itself.
13func TestLinksNameThisRealm(cur realm, t *testing.T) {
14	testing.SetRealm(testing.NewUserRealm(testutils.TestAddress("linker")))
15	Register(cross(cur), "linker")
16	idx := Render("")
17	uassert.True(t, strings.Contains(idx, "[linker](/r/moul/x/daily/handles/v1:linker)"), idx)
18	miss := Render("nobodyhere")
19	uassert.True(t, strings.Contains(miss, "[← all handles](/r/moul/x/daily/handles/v1)"), miss)
20}