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

z_hub_2_b_filetest.gno

0.64 Kb · 30 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v1/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/v1"
10)
11
12func init(cur realm) {
13	testing.SetRealm(testing.NewUserRealm("g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"))
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