z_3_a_filetest.gno
0.67 Kb ยท 35 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/gnoland/boards"
7
8 boards2 "gno.land/r/boards000/v1rc1"
9)
10
11const (
12 owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13 name = "foo123"
14 newName = "bar123"
15)
16
17var bid boards.ID // Operate on board DAO
18
19func init() {
20 testing.SetRealm(testing.NewUserRealm(owner))
21 bid = boards2.CreateBoard(cross, name, false)
22}
23
24func main() {
25 testing.SetRealm(testing.NewUserRealm(owner))
26
27 boards2.RenameBoard(cross, name, newName)
28
29 // Ensure board is renamed by the default board owner
30 bid2, _ := boards2.GetBoardIDFromName(cross, newName)
31 println("IDs match =", bid == bid2)
32}
33
34// Output:
35// IDs match = true