Skip to content

Commit

Permalink
chore: FileKindXtest -> FilKindXTest
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Dec 21, 2024
1 parent 4cfda1e commit 2100a57
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gno.land/pkg/integration/testing_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func (pl *pkgsLoader) LoadPackage(modroot string, path, name string) error {
if err != nil {
return fmt.Errorf("unable to load package imports in %q: %w", currentPkg.Dir, err)
}
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXtest)
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXTest)
for _, imp := range imports {
if imp.PkgPath == currentPkg.Name || gnolang.IsStdlib(imp.PkgPath) {
continue
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/download_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func downloadDeps(io commands.IO, pkgDir string, gnoMod *gnomod.File, fetcher pk
if err != nil {
return fmt.Errorf("read imports at %q: %w", pkgDir, err)
}
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXtest)
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXTest)

for _, pkgPath := range imports {
resolved := gnoMod.Resolve(module.Version{Path: pkgPath.PkgPath})
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/doc/dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func packageImportsRecursive(root string, pkgPath string) []string {
// ignore packages with invalid imports
importsMap = nil
}
resRaw := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXtest)
resRaw := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXTest)
res := make([]string, len(resRaw))
for idx, imp := range resRaw {
res[idx] = imp.PkgPath
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/gnomod/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func ListPkgs(root string) (PkgList, error) {
// ignore imports on error
importsMap = nil
}
importsRaw := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXtest)
importsRaw := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXTest)

imports := make([]string, 0, len(importsRaw))
for _, imp := range importsRaw {
Expand Down
4 changes: 2 additions & 2 deletions gnovm/pkg/packages/filekind.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
FileKindUnknown FileKind = iota
FileKindPackageSource
FileKindTest
FileKindXtest
FileKindXTest
FileKindFiletest
)

Expand Down Expand Up @@ -41,7 +41,7 @@ func GetFileKind(filename string, body string, fset *token.FileSet) (FileKind, e
packageName := ast.Name.Name

if strings.HasSuffix(packageName, "_test") {
return FileKindXtest, nil
return FileKindXTest, nil
}
return FileKindTest, nil
}
2 changes: 1 addition & 1 deletion gnovm/pkg/packages/filekind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestGetFileKind(t *testing.T) {
name: "xtest",
filename: "foo_test.gno",
body: "package foo_test",
fileKind: FileKindXtest,
fileKind: FileKindXTest,
},
{
name: "filetest",
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/packages/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestImports(t *testing.T) {
"gno.land/p/demo/testpkg",
"testing",
},
FileKindXtest: {
FileKindXTest: {
"gno.land/p/demo/testpkg",
"gno.land/p/demo/xtestdep",
"testing",
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/test/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func LoadImports(store gno.Store, memPkg *gnovm.MemPackage) (err error) {
if err != nil {
return err
}
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXtest)
imports := importsMap.Merge(packages.FileKindPackageSource, packages.FileKindTest, packages.FileKindXTest)
for _, imp := range imports {
if gno.IsRealmPath(imp.PkgPath) {
// Don't eagerly load realms.
Expand Down

0 comments on commit 2100a57

Please sign in to comment.