Skip to content

Commit

Permalink
chore: Add challnges/time-simple.txtar. In integration_test, add Test…
Browse files Browse the repository at this point in the history
…TestdataChallenges. See the PR.

Signed-off-by: Jeff Thompson <[email protected]>
  • Loading branch information
jefft0 committed May 14, 2024
1 parent d7c04be commit fc81530
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gno.land/cmd/gnoland/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ import (
func TestTestdata(t *testing.T) {
integration.RunGnolandTestscripts(t, "testdata")
}

func TestTestdataChallenges(t *testing.T) {
integration.RunGnolandTestscripts(t, "testdata/challenges")

Check failure on line 14 in gno.land/cmd/gnoland/integration_test.go

View workflow job for this annotation

GitHub Actions / Run Main / Go Linter / lint

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 14 in gno.land/cmd/gnoland/integration_test.go

View workflow job for this annotation

GitHub Actions / Run Main / Go Linter / lint

File is not `gofumpt`-ed (gofumpt)

Check failure on line 14 in gno.land/cmd/gnoland/integration_test.go

View workflow job for this annotation

GitHub Actions / Run Main / Go Linter / lint

File is not `goimports`-ed (goimports)
}

5 changes: 5 additions & 0 deletions gno.land/cmd/gnoland/testdata/challenges/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# challenges folder

The challenges folder has tests which fail. The challenge is to fix the cause of the failure.
When the test passes, it should be moved to the parent testdata folder.

20 changes: 20 additions & 0 deletions gno.land/cmd/gnoland/testdata/challenges/time-simple.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run this test in ../../gnoland with:
# go test -v . --run TestTestdataChallenges/time-simple
# The addpkg fails due to changes in PR https://github.com/gnolang/gno/pull/1702
# To show that this test should pass, you can revert that PR and run again.

gnoland start

gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/time_simple -gas-fee 1ugnot -gas-wanted 10000000 -broadcast -chainid=tendermint_test test1
stdout OK!

-- time_simple.gno --
package time_simple

import (
"time"
)

func GetUnixTime() int64 {
return time.Now().Unix()
}

0 comments on commit fc81530

Please sign in to comment.