Skip to content

Commit

Permalink
test: add regression integ test for gnoverse/gnochess#97
Browse files Browse the repository at this point in the history
Co-authored-by: Manfred Touron <[email protected]>
  • Loading branch information
thehowl and moul committed Jan 31, 2024
1 parent 12b4b45 commit bd58552
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions gno.land/cmd/gnoland/testdata/issue-gnochess-97.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# test for https://github.com/gnolang/gnochess/issues/97

gnoland start

gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/demo/bug97 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1

gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall1' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1
stdout 'OK!'

gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall2' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1
stdout 'OK!'

gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall1' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1
stdout 'OK!'

-- bug97.gno --
package bug97

var x = [3]int{1, 2, 3}

func newX() [3]int { return x}

type S struct {
Arr [3]int
}

func NewS() S {
return S{Arr: x}
}

var s S

func RealmCall1() {
s = NewS()
}

func RealmCall2() {
arr2 := s.Arr
arr2[0] = 8
s = S{Arr: arr2}
}

0 comments on commit bd58552

Please sign in to comment.