Skip to content

Commit

Permalink
Add packages testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pytimer committed Apr 26, 2022
1 parent 911a16b commit 1536568
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages_test.go
Expand Up @@ -4,6 +4,7 @@ import (
"go/ast"
"go/token"
"path/filepath"
"runtime"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -151,6 +152,20 @@ func TestPackage_rangeFiles(t *testing.T) {
Path: "testdata/simple/api/api.go",
PackagePath: "api",
},
{
Name: &ast.Ident{Name: "foo.go"},
}: {
File: &ast.File{Name: &ast.Ident{Name: "foo.go"}},
Path: "vendor/foo/foo.go",
PackagePath: "vendor/foo",
},
{
Name: &ast.Ident{Name: "bar.go"},
}: {
File: &ast.File{Name: &ast.Ident{Name: "bar.go"}},
Path: filepath.Join(runtime.GOROOT(), "bar.go"),
PackagePath: "bar",
},
}

var sorted []string
Expand Down

0 comments on commit 1536568

Please sign in to comment.