コード例 #1
0
func TestSaveSingleDirectory(t *testing.T) {
	genericDbTest(t, func() {
		dir := new(myfs.Directory)
		dir.InitDirectory("dirname", os.ModeDir|0755, nil)
		dir.SetDirty(true)
		fsdb.PutDirectory(dir)
		anotherDir, _ := fsdb.GetDirectory(dir.Vid)
		assertWithMsg(t, dir.Vid == anotherDir.Vid,
			"Expected Vid to be the same after load.")
		assertWithMsg(t, dir.Name == anotherDir.Name,
			"Expected Name to be the same after load.")
	})
}