GoPLS Viewer

Home|gopls/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//go:build !plan9
6// +build !plan9
7
8package main
9
10import (
11    "io/ioutil"
12    "os"
13    "path/filepath"
14    "testing"
15)
16
17func TestDownloadGoVersion(t *testing.T) {
18    if testing.Short() {
19        t.Skipf("Skipping download in short mode")
20    }
21
22    tmpderr := ioutil.TempDir("""go")
23    if err != nil {
24        t.Fatal(err)
25    }
26    defer os.RemoveAll(tmpd)
27
28    if err := downloadGoVersion("go1.8.1""linux""amd64"filepath.Join(tmpd"go")); err != nil {
29        t.Fatal(err)
30    }
31
32    // Ensure the VERSION file exists.
33    vf := filepath.Join(tmpd"go""VERSION")
34    if _err := os.Stat(vf); os.IsNotExist(err) {
35        t.Fatalf("file %s does not exist and should"vf)
36    }
37}
38
MembersX
TestDownloadGoVersion.err
TestDownloadGoVersion.vf
TestDownloadGoVersion._
testing
TestDownloadGoVersion
TestDownloadGoVersion.t
TestDownloadGoVersion.tmpd
Members
X