From ab3d7f16b8a844d0a2632ef4f2b9cae04b9acdd7 Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Wed, 15 May 2024 11:34:38 +0200 Subject: [PATCH] test(gno.land): time-simple.txtar (#2111) This PR adds a simple regression test for a bug that was introduced in https://github.com/gnolang/gno/pull/1702 and fixed in https://github.com/gnolang/gno/pull/2105 . Signed-off-by: Jeff Thompson --- .../cmd/gnoland/testdata/time-simple.txtar | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gno.land/cmd/gnoland/testdata/time-simple.txtar diff --git a/gno.land/cmd/gnoland/testdata/time-simple.txtar b/gno.land/cmd/gnoland/testdata/time-simple.txtar new file mode 100644 index 00000000000..932a5721695 --- /dev/null +++ b/gno.land/cmd/gnoland/testdata/time-simple.txtar @@ -0,0 +1,18 @@ +# Originally, the addpkg failed due to changes in PR https://github.com/gnolang/gno/pull/1702 . +# This bug was fixed with https://github.com/gnolang/gno/pull/2105 . + +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() +}