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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

zz_links_test.gno

0.60 Kb · 22 lines
 1package connect4
 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 game list links each game to this realm's own page. It once linked
12// to the malformed gno.land/r:<id>.
13func TestListLinksNameThisRealm(cur realm, t *testing.T) {
14	testing.SetRealm(testing.NewUserRealm(testutils.TestAddress("red")))
15	id := NewGame(cross(cur), testutils.TestAddress("yellow"))
16	out := Render("")
17	s := ""
18	for n := id; n > 0; n /= 10 {
19		s = string(rune(byte(n%10)+byte(48))) + s
20	}
21	uassert.True(t, strings.Contains(out, "](/r/nym-moultest123/x/daily/connect4/v1:"+s+")"), out)
22}