Skip to content

Commit

Permalink
test: add missing filetest for board ID getter by name
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Jan 30, 2025
1 parent 7af179b commit 39b94ff
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/gno.land/r/nt/boards2/z_7_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"std"

"gno.land/r/nt/boards2"
)

const (
owner = std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
name = "test123"
)

var bid boards2.BoardID

func init() {
std.TestSetOrigCaller(owner)
bid = boards2.CreateBoard(name)
}

func main() {
bid2, found := boards2.GetBoardIDFromName(name)
println(found)
println(bid2 == bid)
}

// Output:
// true
// true
23 changes: 23 additions & 0 deletions examples/gno.land/r/nt/boards2/z_7_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"std"

"gno.land/r/nt/boards2"
)

const owner = std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1

func init() {
std.TestSetOrigCaller(owner)
}

func main() {
bid, found := boards2.GetBoardIDFromName("foobar")
println(found)
println(bid == 0)
}

// Output:
// false
// true

0 comments on commit 39b94ff

Please sign in to comment.