Giter Club home page Giter Club logo

Comments (3)

jaekwon avatar jaekwon commented on September 25, 2024 1

fixes for the first two cases...

--- a/examples/gno.land/r/demo/releases_example/releases1_filetest.gno
+++ b/examples/gno.land/r/demo/releases_example/releases1_filetest.gno
@@ -1,7 +1,7 @@
 package main
 
 import (
-       "gno.land/r/demo/releases-example"
+       "gno.land/r/demo/releases_example"
 )
 
 func main() {
@@ -17,18 +17,18 @@ func main() {
 
 // Output:
 // -----------
-// # example-app
+// # example_app
 //
-// ## [example-app v2 (latest)](r/demo/examples_example_v2)
+// ## [example_app v2 (latest)](r/demo/examples_example_v2)
 //
 // various improvements
 //
-// ## [example-app v1](r/demo/examples_example_v1)
+// ## [example_app v1](r/demo/examples_example_v1)
 //
 // initial release
 //
 // -----------
-// ## [example-app v1](r/demo/examples_example_v1)
+// ## [example_app v1](r/demo/examples_example_v1)
 //
 // initial release
 //
diff --git a/gnovm/tests/imports.go b/gnovm/tests/imports.go
index 63ccd088..7999160d 100644
--- a/gnovm/tests/imports.go
+++ b/gnovm/tests/imports.go
@@ -457,12 +457,19 @@ func testPackageInjector(store gno.Store, pn *gno.PackageNode) {
        // Also inject stdlibs native functions.
        stdlibs.InjectPackage(store, pn)
        isOriginCall := func(m *gno.Machine) bool {
-               switch m.Frames[0].Func.Name {
+               tname := m.Frames[0].Func.Name
+               switch tname {
                case "main": // test is a _filetest
                        return len(m.Frames) == 3
                case "runtest": // test is a _test
                        return len(m.Frames) == 7
                }
+               // support init() in _filetest
+               // XXX do we need to distinguish from 'runtest'/_test?
+               // XXX pretty hacky even if not.
+               if strings.HasPrefix(string(tname), "init.") {
+                       return len(m.Frames) == 3
+               }
                panic("unable to determine if test is a _test or a _filetest")
        }
        // Test specific injections:

from gno.

moul avatar moul commented on September 25, 2024

should be the case, we'll fix it.

from gno.

moul avatar moul commented on September 25, 2024

I'm on the CI thing on my side.

Edit: #784

from gno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.