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:
parent
c9d84a0ca2
commit
4d818318a2
1 changed files with 9 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue