z_2_b_filetest.gno
0.63 Kb · 30 lines
1// Test getting boards
2package main
3
4import (
5 "testing"
6
7 boards2 "gno.land/r/gnoland/boards2/v1"
8 "gno.land/r/gnoland/boards2/v1/hub"
9)
10
11func init() {
12 testing.SetRealm(testing.NewUserRealm("g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"))
13 boards2.CreateBoard(cross, "aaa123", false, false)
14 boards2.CreateBoard(cross, "bbb123", false, false)
15 boards2.CreateBoard(cross, "ccc123", false, false)
16}
17
18func main() {
19 testing.SetRealm(testing.NewCodeRealm("gno.land/r/gnoland/boards2/test"))
20 boards := hub.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