1// Copyright 2018 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
5package modfetch
6
7import (
8	"io/ioutil"
9	"os"
10	"path/filepath"
11	"testing"
12)
13
14func TestWriteDiskCache(t *testing.T) {
15	tmpdir, err := ioutil.TempDir("", "go-writeCache-test-")
16	if err != nil {
17		t.Fatal(err)
18	}
19	defer os.RemoveAll(tmpdir)
20
21	err = writeDiskCache(filepath.Join(tmpdir, "file"), []byte("data"))
22	if err != nil {
23		t.Fatal(err)
24	}
25}
26