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
|
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",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue