Search Apps Documentation Source Content File Folder Download Copy Actions Download

z4_filetest.gno

0.78 Kb · 26 lines
 1package main
 2
 3import (
 4	"chain"
 5	"testing"
 6
 7	tests "gno.land/r/tests/vm"
 8)
 9
10func main() {
11	testing.SetOriginSend(chain.Coins{{Denom: "foo", Amount: 42}, {Denom: "ugnot", Amount: 100}})
12	println("tests.RealmSentCoins: " + tests.RealmSentCoins(cross))
13	println("tests.BankerOriginSend: " + tests.BankerOriginSend(cross))
14
15	// subtests is cross-called from tests, so cur.SentCoins() returns empty there.
16	println("tests.RTestsRealmSentCoins: " + tests.RTestsRealmSentCoins(cross))
17	// banker.OriginSend() always returns the origin send regardless of call
18	// depth.
19	println("tests.RTestsOriginSend: " + tests.RTestsOriginSend(cross))
20}
21
22// Output:
23// tests.RealmSentCoins: 42foo,100ugnot
24// tests.BankerOriginSend: 42foo,100ugnot
25// tests.RTestsRealmSentCoins:
26// tests.RTestsOriginSend: 42foo,100ugnot