Skip to content

Commit

Permalink
test: test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Mar 15, 2024
1 parent 0453cf8 commit 4764a84
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/gno.land/r/r3v4/ra/ra.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ra

import (
"std"

"gno.land/r/r3v4/rb"
)

func Info() {
println("ra.Info")
println("std.GetOrigCaller:", std.GetOrigCaller())
println("std.GetOrigPkgAddr:", std.GetOrigPkgAddr())
println("std.PrevRealm():", std.PrevRealm())
println("std.CurrentRealm():", std.CurrentRealm())
println("CALLING rb.Info()")
rb.Info()
}
9 changes: 9 additions & 0 deletions examples/gno.land/r/r3v4/ra/ra_test.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ra

import (
"testing"
)

func TestFuncs(t *testing.T) {
Info()
}
14 changes: 14 additions & 0 deletions examples/gno.land/r/r3v4/rb/rb.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package rb

import (
"std"
)

func Info() {
println("rb.Info")
println("std.GetOrigCaller():", std.GetOrigCaller())
println("std.GetOrigPkgAddr():", std.GetOrigPkgAddr())
println("std.PrevRealm():", std.PrevRealm())
println("std.CurrentRealm():", std.CurrentRealm())
println()
}
20 changes: 20 additions & 0 deletions examples/gno.land/r/r3v4/rb/rb_test.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// PKGPATH: gno.land/r/r3v4/ra
package rb

import (
"std"
"testing"

"gno.land/p/demo/testutils"
)

func Test_TestSetPrevRealm(t *testing.T) {
std.TestSetPrevRealm("gno.land/r/demo/thisgoes")
Info()
}

func Test_TestSetPrevAddr(t *testing.T) {
dummy := testutils.TestAddress("dummy")
std.TestSetPrevAddr(dummy)
Info()
}

0 comments on commit 4764a84

Please sign in to comment.