X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.1.0%2Fcmd%2Fgetgo%2Fdownload_test.go;fp=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.1.0%2Fcmd%2Fgetgo%2Fdownload_test.go;h=5a5cc29130b945b446a8a1c530a91dda83f9aa47;hb=3c06164f15bd10aed7d66b6314764a2961a14762;hp=0000000000000000000000000000000000000000;hpb=0e9c3ceb40901f4d44981c1376cb9e23a248e006;p=dotfiles%2F.git diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/cmd/getgo/download_test.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/cmd/getgo/download_test.go new file mode 100644 index 00000000..5a5cc291 --- /dev/null +++ b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/cmd/getgo/download_test.go @@ -0,0 +1,36 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +package main + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" +) + +func TestDownloadGoVersion(t *testing.T) { + if testing.Short() { + t.Skipf("Skipping download in short mode") + } + + tmpd, err := ioutil.TempDir("", "go") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpd) + + if err := downloadGoVersion("go1.8.1", "linux", "amd64", filepath.Join(tmpd, "go")); err != nil { + t.Fatal(err) + } + + // Ensure the VERSION file exists. + vf := filepath.Join(tmpd, "go", "VERSION") + if _, err := os.Stat(vf); os.IsNotExist(err) { + t.Fatalf("file %s does not exist and should", vf) + } +}