Skip to content

Commit

Permalink
chore: add bug example
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Apr 25, 2023
1 parent 7ac2a9d commit 33b1687
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/gno.land/r/demo/bug/bug.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package bug

var number int = 0

func SetNumber(n int) {
number = n
}

func GetNumber() int {
return number
}

func reset() {
number = 0
}
12 changes: 12 additions & 0 deletions examples/gno.land/r/demo/bug/bug_test.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package bug

import (
"testing"
)

func TestSetNumber(t *testing.T) {
defer reset()
println(GetNumber())
SetNumber(42)
println(GetNumber())
}

0 comments on commit 33b1687

Please sign in to comment.