Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / cmd / getgo / download_test.go
1 // Copyright 2017 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build !plan9
6
7 package main
8
9 import (
10         "io/ioutil"
11         "os"
12         "path/filepath"
13         "testing"
14 )
15
16 func TestDownloadGoVersion(t *testing.T) {
17         if testing.Short() {
18                 t.Skipf("Skipping download in short mode")
19         }
20
21         tmpd, err := ioutil.TempDir("", "go")
22         if err != nil {
23                 t.Fatal(err)
24         }
25         defer os.RemoveAll(tmpd)
26
27         if err := downloadGoVersion("go1.8.1", "linux", "amd64", filepath.Join(tmpd, "go")); err != nil {
28                 t.Fatal(err)
29         }
30
31         // Ensure the VERSION file exists.
32         vf := filepath.Join(tmpd, "go", "VERSION")
33         if _, err := os.Stat(vf); os.IsNotExist(err) {
34                 t.Fatalf("file %s does not exist and should", vf)
35         }
36 }