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

z_hub_2_b_filetest.gno

0.64 Kb · 30 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_hub_2_b_filetest
 2
 3// Test getting boards
 4package z_hub_2_b_filetest
 5
 6import (
 7	"testing"
 8
 9	boards2 "gno.land/r/gnoland/boards2/v0"
10)
11
12func init(cur realm) {
13	testing.SetRealm(testing.NewUserRealm("g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"))
14	boards2.CreateBoard(cross(cur), "aaa123", false, false)
15	boards2.CreateBoard(cross(cur), "bbb123", false, false)
16	boards2.CreateBoard(cross(cur), "ccc123", false, false)
17}
18
19func main(cur realm) {
20	boards := boards2.GetBoards(0, boards2.BoardCount())
21
22	for _, b := range boards {
23		println(b.ID(), b.Name())
24	}
25}
26
27// Output:
28// 1 aaa123
29// 2 bbb123
30// 3 ccc123