From 4d818318a2fa0b9fce5f91c4f0518d7d0ea638f3 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 20 Jun 2025 10:31:20 +0200 Subject: [PATCH] uri_test.go: test filename with $GOROOT --- uri_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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",