diff --git a/uri_test.go b/uri_test.go index 936430b..be5b942 100644 --- a/uri_test.go +++ b/uri_test.go @@ -5,12 +5,15 @@ package uri import ( + "os" "testing" "github.com/google/go-cmp/cmp" ) func TestFile(t *testing.T) { + os.Setenv("GOROOT", "/go/root") + tests := []struct { name string path string @@ -23,6 +26,12 @@ func TestFile(t *testing.T) { want: URI(FileScheme + hierPart + "/users/me/c%23-projects"), wantErr: false, }, + { + name: "Goroot", + path: "$GOROOT/bin/go", + want: URI(FileScheme + hierPart + "/go/root/bin/go"), + wantErr: false, + }, { name: "Invalid", path: "users-me-c#-projects",