dynamic_fs_test: run goimports and reflow text.

geesefs-0-30-9
Aaron Jacobs 2017-05-09 07:47:11 +10:00
parent 4fc546bdf9
commit df7caed6a7
1 changed files with 15 additions and 13 deletions

View File

@ -3,19 +3,20 @@ package dynamicfs_test
import ( import (
"testing" "testing"
"github.com/jacobsa/fuse/fusetesting"
"github.com/jacobsa/fuse/samples" "github.com/jacobsa/fuse/samples"
"github.com/jacobsa/fuse/samples/dynamicfs" "github.com/jacobsa/fuse/samples/dynamicfs"
"github.com/jacobsa/fuse/fusetesting"
. "github.com/jacobsa/ogletest" "bytes"
. "github.com/jacobsa/oglematchers" "fmt"
"io/ioutil"
"os" "os"
"path" "path"
"syscall" "syscall"
"io/ioutil"
"fmt"
"time" "time"
"bytes"
. "github.com/jacobsa/oglematchers"
. "github.com/jacobsa/ogletest"
) )
func TestDynamicFS(t *testing.T) { RunTests(t) } func TestDynamicFS(t *testing.T) { RunTests(t) }
@ -135,8 +136,9 @@ func (t *DynamicFSTest) ReadFile_AgeUnchangedForHandle() {
file, err = os.Open(path.Join(t.Dir, "age")) file, err = os.Open(path.Join(t.Dir, "age"))
AssertEq(nil, err) AssertEq(nil, err)
// Ensure that all reads from the same handle return the contents created at file open time. // Ensure that all reads from the same handle return the contents created at
func (file *os.File) { // file open time.
func(file *os.File) {
defer file.Close() defer file.Close()
var expectedContents string var expectedContents string
@ -150,8 +152,8 @@ func (t *DynamicFSTest) ReadFile_AgeUnchangedForHandle() {
ExpectEq(expectedContents, buffer.String()) ExpectEq(expectedContents, buffer.String())
t.Clock.SetTime(gCreateTime.Add(1000 * time.Second)) t.Clock.SetTime(gCreateTime.Add(1000 * time.Second))
// Seek back to the beginning of the file. The contents should be unchanged for the life of the // Seek back to the beginning of the file. The contents should be unchanged
// file handle. // for the life of the file handle.
_, err = file.Seek(0, 0) _, err = file.Seek(0, 0)
AssertEq(nil, err) AssertEq(nil, err)
@ -162,11 +164,11 @@ func (t *DynamicFSTest) ReadFile_AgeUnchangedForHandle() {
ExpectEq(expectedContents, buffer.String()) ExpectEq(expectedContents, buffer.String())
}(file) }(file)
// The clock was advanced while the old handle was open. The content change should be reflected // The clock was advanced while the old handle was open. The content change
// by the new handle. // should be reflected by the new handle.
file, err = os.Open(path.Join(t.Dir, "age")) file, err = os.Open(path.Join(t.Dir, "age"))
AssertEq(nil, err) AssertEq(nil, err)
func (file *os.File) { func(file *os.File) {
defer file.Close() defer file.Close()
expectedContents := "This filesystem is 1000 seconds old." expectedContents := "This filesystem is 1000 seconds old."