Skip to content

Commit

Permalink
Fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achew22 committed Feb 24, 2019
1 parent 5fc7693 commit cffc2c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion gazelle/fileinfo_test.go
Expand Up @@ -23,7 +23,10 @@ import (
"testing"
)

func TestProtoFileInfo(t *testing.T) {
// TestFileInfo tests that when a FileInfo object is constructed from the
// provided input of the `sass` parameter, the output contains the correct
// set of imports.
func TestFileInfo(t *testing.T) {
for _, tc := range []struct {
desc, name, sass string
want FileInfo
Expand Down
6 changes: 4 additions & 2 deletions gazelle/parser/BUILD.bazel
Expand Up @@ -25,8 +25,10 @@ go_test(
srcs = ["tokenizer_test.go"],
data = [":testdata"],
embed = [":go_default_library"],
rundir = "gazelle/parser",
deps = ["@com_github_google_go_cmp//cmp:go_default_library"],
deps = [
"@com_github_google_go_cmp//cmp:go_default_library",
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
],
)

filegroup(
Expand Down
9 changes: 8 additions & 1 deletion gazelle/parser/tokenizer_test.go
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"testing"

"github.com/bazelbuild/rules_go/go/tools/bazel"
"github.com/google/go-cmp/cmp"
)

Expand Down Expand Up @@ -617,7 +618,13 @@ func TestScanNumber(t *testing.T) {

func TestLargeInputs(t *testing.T) {
found := false
if err := filepath.Walk("testdata", func(path string, info os.FileInfo, err error) error {

testDataDir, err := bazel.Runfile(filepath.Join("gazelle", "parser", "testdata"))
if err != nil {
t.Fatalf("Error finding runfile gazelle/parser/testdata: %s", err)
}

if err := filepath.Walk(testDataDir, func(path string, info os.FileInfo, err error) error {
// Don't parse the root, or directories.
if info == nil || info.IsDir() {
return nil
Expand Down

0 comments on commit cffc2c2

Please sign in to comment.