Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Test tip on travis #236

Merged
merged 7 commits into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: go
go:
- 1.8.x
- 1.9.x
- tip

go_import_path: github.com/sourcegraph/go-langserver

Expand Down
4 changes: 2 additions & 2 deletions langserver/langserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ package main; import "test/pkg"; func B() { p.A(); B() }`,
"goroot": {
rootURI: "file:///src/test/pkg",
fs: map[string]string{
"a.go": `package p; import "fmt"; var _ = fmt.Println; var x int`,
"a.go": `package p; import "fmt"; var _ = fmt.Println; var x int; type _ = fmt.State`,
},
mountFS: map[string]map[string]string{
"/goroot": {
Expand All @@ -449,7 +449,7 @@ package main; import "test/pkg"; func B() { p.A(); B() }`,
// "a.go:1:53": "type int int",
},
overrideGodefDefinition: map[string]string{
"a.go:1:40": "/goroot/src/fmt/print.go:256:6-256:13", // hitting the real GOROOT
"a.go:1:71": "/goroot/src/fmt/print.go:38:6-38:11", // hitting the real GOROOT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every small change in the src will fail this test case. Is there a better approach to this? Maybe just assert that a valid file and line number is returned?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that sounds much better. It requires a bit of cleaning up in our tests, but that seems fine given this is relying on GOROOT of the user running the tests. Right now the location I have picked hasn't changed in 2 years.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to test path instead for this specific test.

"a.go:1:53": "/goroot/src/builtin/builtin.go:1:1-1:1", // TODO: accurate builtin positions
},
wantDefinition: map[string]string{
Expand Down