1
0
Fork 0
mirror of https://github.com/laravel-ls/uri synced 2026-06-16 01:54:57 +02:00

uri_test.go: test filename with $GOROOT

This commit is contained in:
Henrik Hautakoski 2025-06-20 10:31:20 +02:00
parent c9d84a0ca2
commit 4d818318a2

View file

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