summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/internal/modfetch/cache_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/internal/modfetch/cache_test.go')
-rw-r--r--libgo/go/cmd/go/internal/modfetch/cache_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/internal/modfetch/cache_test.go b/libgo/go/cmd/go/internal/modfetch/cache_test.go
new file mode 100644
index 00000000000..241c800e692
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modfetch/cache_test.go
@@ -0,0 +1,25 @@
+// Copyright 2018 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.
+
+package modfetch
+
+import (
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+func TestWriteDiskCache(t *testing.T) {
+ tmpdir, err := ioutil.TempDir("", "go-writeCache-test-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer os.RemoveAll(tmpdir)
+
+ err = writeDiskCache(filepath.Join(tmpdir, "file"), []byte("data"))
+ if err != nil {
+ t.Fatal(err)
+ }
+}