You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods defined on _test.gno files are not recognised on test files
Description
Found this while porting the strings.Replacer on standard lib 'strings' #2816
specifically on stdlibs/strings/export_test.gno.
there we define PrintTrie function func (r *Replacer) PrintTrie() string {
Your environment
Gno commit hash causing the issue : lastest
Steps to reproduce
Tell us how to reproduce this issue
Where the issue is, if you know
Which commands triggered the issue, if any
Expected behaviour
On Go you can define exported Methods to use on the test as for example they do on standard library strings with PrintTrie function. This allows developers to use said function on the test without exporting the method on the non-test context.
Actual behaviour
Currently on Gno the method is not recognized on both test and non-test contexts.
will output ok github.com/gnolang/gno/gotest 0.512s
While on Gno the same setup will output ; panic: strings_test/testfunc_test.gno:9:2: missing field DoSomething in *strings.Doer:
plus more stacktrace
Tested on std libs
Proposed solution
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered:
Villaquiranm
changed the title
Methods defined on _test.gno filed are not recognised on test files
Methods defined on _test.gno files are not recognised on test files
Oct 2, 2024
Methods defined on _test.gno files are not recognised on test files
Description
Found this while porting the strings.Replacer on standard lib 'strings' #2816
specifically on stdlibs/strings/export_test.gno.
there we define PrintTrie function
func (r *Replacer) PrintTrie() string {
Your environment
Steps to reproduce
Expected behaviour
On Go you can define exported Methods to use on the test as for example they do on standard library strings with PrintTrie function. This allows developers to use said function on the test without exporting the method on the non-test context.
Actual behaviour
Currently on Gno the method is not recognized on both test and non-test contexts.
Logs
On Go
will output
ok github.com/gnolang/gno/gotest 0.512s
While on Gno the same setup will output
; panic: strings_test/testfunc_test.gno:9:2: missing field DoSomething in *strings.Doer:
plus more stacktrace
Tested on std libs
Proposed solution
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered: