Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Forbid import cycles in *_test.gno files? #1394

Open
harry-hov opened this issue Nov 27, 2023 · 0 comments
Open

[RFC] Forbid import cycles in *_test.gno files? #1394

harry-hov opened this issue Nov 27, 2023 · 0 comments
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related ❓ question Questions about Gno

Comments

@harry-hov
Copy link
Contributor

Description

A while back I noticed we can self import a pkg in _test.gno files. For example this is a totally valid gno test file.

avl_test.gno:

package avl // import path `gno.land/p/demo/avl`

import (
       "testing"

       "gno.land/p/demo/avl" // importing itself
)

func TestXXX(t *testing.T) {
	t := avl.Tree{}
	_ = t
}

I'm aware that we never run _test.gno files on chain. But since we publish them on chain and are a part of pkg/realm. We should validate them before publishing and disallow self import to keep the behaviour consistent with Go.

--

PR #1206 highlights/removes all the instances of import cycles in _test.gno files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related ❓ question Questions about Gno
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

1 participant